Reply
Thread Tools
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#1
Hi,
looking for suggestions/ideas/code/methods for making python faster!

in #maemo irc, x-fade remembered about a pylauncher project, but does not know of its active status in fremantle:
http://pylauncher.garage.maemo.org/

what other things can we do to effectively speed up python
simple things, suggestions metrics etc
does removing the comments make a noticable difference to script runtime?
mini ad-hoc brainstorming session..


================================================== ====
Update, added wiki page results

A couple of weeks later and after much discussion and testing we have a fairly decent set of guidelines and best practices \o/

Performance_Considerations_for_Python_Apps


thanks to epage for the excellent wiki writeup
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk

Last edited by lcuk; 2010-05-20 at 14:20.
 

The Following 11 Users Say Thank You to lcuk For This Useful Post:
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#2
Is this possible on ARM:

http://psyco.sourceforge.net/
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 

The Following 3 Users Say Thank You to Bundyo For This Useful Post:
Posts: 77 | Thanked: 160 times | Joined on Nov 2009 @ T.M.O
#3
I'm not a developer so not 100% sure, but this thread is somewhat similar/hopefully helpful.

http://talk.maemo.org/showthread.php?t=47850

Edit: just noticed that the other thread is only for improving the inital startup times and not in general. My bad

Last edited by un-named_user; 2010-04-22 at 11:13.
 

The Following 3 Users Say Thank You to un-named_user For This Useful Post:
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#4
Originally Posted by un-named_user View Post
I'm not a developer so not 100% sure, but this thread is somewhat similar/hopefully helpful.

http://talk.maemo.org/showthread.php?t=47850

Edit: just noticed that the other thread is only for improving the inital startup times and not in general. My bad.
don't apologise - its all part of the same thing!
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 

The Following User Says Thank You to lcuk For This Useful Post:
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#5
Interesting post....... I feel i may be able to provide a few tests to back up issues....

Healthcheck currently has about 300 redundant lines of code (Comments + Blank lines) probably 25% of the total.

I'll run a version of it without all of those and compare load times
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 

The Following 4 Users Say Thank You to noobmonkey For This Useful Post:
Posts: 77 | Thanked: 160 times | Joined on Nov 2009 @ T.M.O
#6
@lcuk
My damn N900 ate the smiley for some reason & made me look like a sad panda

Anyways good to see the overall scheme includes start up improvements too.
 
mikec's Avatar
Posts: 1,366 | Thanked: 1,185 times | Joined on Jan 2006
#7
The import method of not importing everything has some postive impacts, though probably small.

- reduce startup time
- reduces code size as your code no longer has to refer to the base class. ie qtcore.qrectangle becomes just qrectangle
- not sure if references become a bit faster internally, but feels right to me.

I would also use constants where possible rather than have them values recalculated, as is often the case in code.

given most heavy lifting code is done inside the libraries like qt I,m not sure python is much slower, and if you ae not using libraries why not especially given the richness of them. of course YMMV
__________________
N900_Email_Options Wiki Page
 

The Following 4 Users Say Thank You to mikec For This Useful Post:
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#8
from irc:
<frals> right fixed the gtk import now anyway so the daemon doesnt import it, not sure about startup time but its taking 13MB less in memory :P
that sounds like an improvement right off the bat!
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 

The Following User Says Thank You to lcuk For This Useful Post:
Posts: 999 | Thanked: 1,117 times | Joined on Dec 2009 @ earth?
#9
When we talk about making Python "faster" do we mean:
(a) perceptionally faster (e.g. time to reach first screen)
(b) execution speed
__________________
I like cake.
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#10
Originally Posted by Bundyo View Post
Is this possible on ARM:

http://psyco.sourceforge.net/
The concept, yes, but isn't really popular on ARM as it uses quite a bit of memory, which is often not in abundance in the embedded world. There were pioneering attempts on ARM (not the 'real' psyco, that one is i386+ only), but I have no idea what phase did they get to.

Also, for tricks using preloaders: Please consider what that does to memory - keeping GTK and/or QT bindings in there is quite a burden, think it through before you commit to such a thing.
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 

The Following 2 Users Say Thank You to attila77 For This Useful Post:
Reply

Tags
performance, python


 
Forum Jump


All times are GMT. The time now is 02:44.