[issue25557] Optimize LOAD_NAME bytecode

2015-11-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Victor. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue25557] Optimize LOAD_NAME bytecode

2015-11-20 Thread STINNER Victor
STINNER Victor added the comment: Since LOAD_NAME is rare, I don't think that it's worth to optimize it. I pushed a partial version of pydict_loadname-2.patch to add comments to the code. -- resolution: -> fixed status: open -> closed ___ Python tr

[issue25557] Optimize LOAD_NAME bytecode

2015-11-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset c35d65c9ded3 by Victor Stinner in branch 'default': Issue #25557: Refactor _PyDict_LoadGlobal() https://hg.python.org/cpython/rev/c35d65c9ded3 -- nosy: +python-dev ___ Python tracker

[issue25557] Optimize LOAD_NAME bytecode

2015-11-05 Thread STINNER Victor
STINNER Victor added the comment: Rebased patch (ceval.c was modified by the changeset of c1414f80ebc9, issue #25556). -- Added file: http://bugs.python.org/file40954/pydict_loadname-2.patch ___ Python tracker ___

[issue25557] Optimize LOAD_NAME bytecode

2015-11-05 Thread STINNER Victor
STINNER Victor added the comment: > When LOAD_NAME is generated? Is it worth to optimize this case? Aren't > LOAD_FAST and LOAD_GLOBAL used in performance critical code? I guess that it's only used to execute the body of modules. > Is it worth to optimize this case? Hum, I don't know :-) > I

[issue25557] Optimize LOAD_NAME bytecode

2015-11-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: When LOAD_NAME is generated? Is it worth to optimize this case? Aren't LOAD_FAST and LOAD_GLOBAL used in performance critical code? It looks to me that there is a bug in fast path of _PyDict_LoadGlobal. If the first lookup fails, it can raise an exception. W

[issue25557] Optimize LOAD_NAME bytecode

2015-11-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue25557] Optimize LOAD_NAME bytecode

2015-11-05 Thread STINNER Victor
New submission from STINNER Victor: The LOAD_GLOBAL bytecode has a fast-path when globals and builtins have exactly the type 'dict'. It calls the _PyDict_LoadGlobal() function. I propose to implement a similar optimization for LOAD_NAME, see attached patch. The patch also fixes LOAD_GLOBAL and