![]() |
Re: Making Python faster (for fmms initially)
Quote:
AsyncLinearExecutor code: https://garage.maemo.org/plugins/ggi...51e98721401e72 Code that uses AsyncLinearExecutor: https://garage.maemo.org/plugins/ggi...51e98721401e72 |
Re: Making Python faster (for fmms initially)
Quote:
|
Re: Making Python faster (for fmms initially)
Quote:
|
Re: Making Python faster (for fmms initially)
Quote:
|
Re: Making Python faster (for fmms initially)
Well, depending on the case, Cython can be a very handy tool...
|
Re: Making Python faster (for fmms initially)
Also :
- Avoid while loop when you can use a "for foo in foo_list" - use xrange instead of range (removed in python 3 so it s not really a good idea for compatibility) ah and of course, Read this : http://wiki.python.org/moin/PythonSpeed/PerformanceTips |
Re: Making Python faster (for fmms initially)
Quote:
it propbably won't make too much difference but if we can get a line count before and one after if there is any kind of difference it can go into the melting pot :) |
Re: Making Python faster (for fmms initially)
Ahaaaaaaaaaaa i'm back! and had time to do it! yay!
First test - normal code 2104 lines of code 580 blank lines 215 code lines Load time from icon click to fully loaded - 10.04 seconds Second Test - Cleared up code 2104 lines of code 0 blank lines 80 code lines Load time from icon click to fully loaded - 9.25 seconds Ok, it was a basic test, but i ran them side by side for a while with nothing else loaded... the load times where almost exactly the same each time. So... yes blank lines do affect load up! My next test, later this week will be to remove redundant lines into sensible functions - should cut my lines of code down a lot...... so will compare that against these results. :D quick edit :- Third - Cleared up code!! 1469 lines of code 0 blank lines 80 code lines Load time from icon click to fully loaded - 8.40 (5 tests , from 8.09 to 8.60) (Sorry code lines probably don't mean much - i meant comment lines!) |
Re: Making Python faster (for fmms initially)
noobmonk3y - so you just saved 20% of the load time by scrubbing your code?
thats remarkable (tho extreme, we like comments) i did not expect the difference to be so great. if we could strip them from debs as part of packaging for most python apps that would be wicked (keep them in source of course) |
Re: Making Python faster (for fmms initially)
@noobmonkey: use the import trick from my presentation, that way you can save the time required for parsing (empty lines or not).
|
| All times are GMT. The time now is 10:31. |
vBulletin® Version 3.8.8