psyco test

0 views
Skip to first unread message

Ville M. Vainio

unread,
Jul 22, 2009, 5:41:06 PM7/22/09
to leo-e...@googlegroups.com
You can test leo with psyco V2 by just starting psyco in launchleo:

QQQ

import psyco
psyco.full()

import leo.core.runLeo
leo.core.runLeo.run()

QQQ

I ran unit tests, and saw modest improvements:


 86.865 sec (without psyco)
 70.781 sec (with psyco)

So, around ~20% improvement. However, that's for the test suite - if we had a proper benchmark about what leo really is used for, the resurts would be more apparent. Cherry-picking parts of Leo as psyco candidates will definitely be worth it.The fact that a "full" psyco round can be executed without problems, and with actual performance increase is impressive enough in itself.


--
Ville M. Vainio
http://tinyurl.com/vainio

Edward K. Ream

unread,
Jul 24, 2009, 9:53:04 AM7/24/09
to leo-e...@googlegroups.com
On Wed, Jul 22, 2009 at 4:41 PM, Ville M. Vainio <viva...@gmail.com> wrote:
You can test leo with psyco V2 by just starting psyco in launchleo:

QQQ

import psyco
psyco.full()

import leo.core.runLeo
leo.core.runLeo.run()

QQQ

I ran unit tests, and saw modest improvements:


 86.865 sec (without psyco)
 70.781 sec (with psyco)

Thanks for this report.  Perhaps Leo should support a --psyco option.  Enabling psyco in launchLeo.py works, but there is no easy way to enable it under control of the command line.

Edward

Ville M. Vainio

unread,
Jul 24, 2009, 10:00:46 AM7/24/09
to leo-e...@googlegroups.com
On Fri, Jul 24, 2009 at 4:53 PM, Edward K. Ream<edre...@gmail.com> wrote:

>>  86.865 sec (without psyco)
>>  70.781 sec (with psyco)
>
> Thanks for this report.  Perhaps Leo should support a --psyco option.
> Enabling psyco in launchLeo.py works, but there is no easy way to enable it
> under control of the command line.

I don't think we should do "full" psyco'ing anyway, to prevent memory
bloat. Psyco is best applied in hand-picked code segments; perhaps we
should enable/disable psyco with g.use_psyco (just like we do with
unified nodes currently).

Edward K. Ream

unread,
Jul 24, 2009, 10:51:40 AM7/24/09
to leo-e...@googlegroups.com
On Fri, Jul 24, 2009 at 9:00 AM, Ville M. Vainio <viva...@gmail.com> wrote:

I don't think we should do "full" psyco'ing anyway, to prevent memory
bloat. Psyco is best applied in hand-picked code segments; perhaps we
should enable/disable psyco with g.use_psyco (just like we do with
unified nodes currently).

Seems reasonable.  In particular, leoGlobals.leo is imported first in runLeo.py.
See  << imports and inits>>

Edward

Ville M. Vainio

unread,
Jul 24, 2009, 6:57:54 PM7/24/09
to leo-e...@googlegroups.com
On Thu, Jul 23, 2009 at 12:41 AM, Ville M. Vainio<viva...@gmail.com> wrote:

> I ran unit tests, and saw modest improvements:
>
>
>  86.865 sec (without psyco)
>  70.781 sec (with psyco)
>
> So, around ~20% improvement. However, that's for the test suite - if we had
> a proper benchmark about what leo really is used for, the resurts would be
> more apparent. Cherry-picking parts of Leo as psyco candidates will
> definitely be worth it.The fact that a "full" psyco round can be executed
> without problems, and with actual performance increase is impressive enough
> in itself.

I noted that psyco.full() is the only "easy" mode that provides
performance increase.

Now (with my fix-nhist branch), I got following results:

no psyco: 51sec
psyco.full() : 41 sec
psyco.profile(): 161 sec

psyco.background(): 76 sec

Apparently, profile / background cause pathological slowdown in some
areas towards the end of the test.

Now, it will be interesting to see where we can reap psyco's speedups
in extremely controlled fashion, e.g. using

import psyco
psyco.bind(myfunction1)

http://psyco.sourceforge.net/psycoguide/psycodotclasses.html
http://psyco.sourceforge.net/psycoguide/psycocompact.html

Edward K. Ream

unread,
Jul 25, 2009, 9:50:43 AM7/25/09
to leo-e...@googlegroups.com
On Fri, Jul 24, 2009 at 5:57 PM, Ville M. Vainio <viva...@gmail.com> wrote:

I noted that psyco.full() is the only "easy" mode that provides
performance increase.

Now (with my fix-nhist branch), I got following results:

no psyco: 51sec
psyco.full() : 41 sec
psyco.profile(): 161 sec

psyco.background(): 76 sec

Many thanks for this work, Ville.  This looks like a 20% improvement, easily obtained.  That's always worthwhile.

Edward
Reply all
Reply to author
Forward
0 new messages