... | ... | @@ -22,6 +22,10 @@ New style classes are faster than old style classes. Both are much faster than c |
|
|
|
|
|
The simpler your calls are the better. Passing normal arguments should not pose big performance hit, while always passing a very general {{{*args}}} and {{{**kwargs}}} might. The actual depth of the call stack does not matter that much, since a lot of it might end up being inlined and generating no extra code at all.
|
|
|
|
|
|
== Frame ntrospection ==
|
|
|
|
|
|
{{{sys._getframe()}}}, {{{sys.exc_info()}}} work, but they give performance penalty that can be huge, by disabling the JIT. Use only for specialized use cases (like a debugger) where performance does not matter.
|
|
|
|
|
|
== Things that are known to be slow, but shouldn't be ==
|
|
|
|
|
|
=== Generators ===
|
... | ... | @@ -30,4 +34,8 @@ As of now (Feb 2011) generators are usually slower than corresponding code not u |
|
|
|
|
|
=== String joining ===
|
|
|
|
|
|
As of now (Feb 2011) xxx |
|
|
\ No newline at end of file |
|
|
As of now (Feb 2011) using {{{cStringIO}}} is faster than {{{''.join(list)}}}. This should be fixed at some point.
|
|
|
|
|
|
=== Profiling and tracing ===
|
|
|
|
|
|
{{{sys.setprofile}}} and {{{sys.settrace}}} disable JIT. At least for profiling we should do something better, work in progress. |
|
|
\ No newline at end of file |