... | @@ -22,10 +22,6 @@ New style classes are faster than old style classes. Both are much faster than c |
... | @@ -22,10 +22,6 @@ 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.
|
|
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.
|
|
|
|
|
|
=== Struct Passing ===
|
|
|
|
|
|
|
|
PyPy's JIT does not optimize instance attribute access as much as it will optimize parameter usage. This means that code which passes around a "state" object which is constantly being mutated and accessed will run slower than code which passes individual parameters to each method.
|
|
|
|
|
|
|
|
=== Frame introspection ===
|
|
=== Frame introspection ===
|
|
|
|
|
|
{{{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.
|
|
{{{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.
|
... | | ... | |