Calling a function is faster than not calling it?

Ian Kelly ian.g.kelly at gmail.com
Sun May 10 12:25:24 EDT 2015


On Sun, May 10, 2015 at 10:14 AM, Peter Otten <__peter__ at web.de> wrote:
> When there was an actual speed-up I also had a look at
> PyEval_GetGlobals/Locals() which in turn call
>
> PyEval_GetFrame()
>
> and
>
> PyEvalPyFrame_FastToLocalsWithError()
>
> whatever these do. (The first function reminded me of sys._getframe() hence
> the mention of stack inspection)

Based on the names, I surmise that the first one gets the top stack
frame object, and that the second one extracts the "fast" local
variables from the frame object and builds a dict of them for use by
eval.



More information about the Python-list mailing list