Serhiy Storchaka added the comment:

The argument about "harmonizing" doesn't look strong to me. Opcodes for locals 
use the SETLOCAL() macro which decrefs 
old value, while opcodes for nonlocals with your patches use the PyCell_SET() 
macro which doesn't.

But performance arguments look more weighty. I made benchmarks. fastcell.diff 
speeds up STORE_FAST by 40%, delete_deref.diff speeds up DELETE_DEREF by 50%. 
and concat_deref.diff speeds up string concatenating up to 15%. All these 
operations are rare in comparison with operations with locals or LOAD_DEREF, 
but the cognitive cost of the optimization is pretty low. All patches LGTM.

I only have doubts that such changes could be pushed in 3.6 at this stage. This 
is not bug fix and isn't tweaking new 3.6 feature.

----------
assignee: serhiy.storchaka -> rhettinger
stage: patch review -> commit review
versions:  -Python 3.6
Added file: http://bugs.python.org/file45457/issue28665.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28665>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to