Serhiy Storchaka added the comment:

With call_stack-2.patch attribute access in namedtuple is only 25% slower than 
attribute access in ordinary Python object! Definitely this this worth to 
continue to experiment!

But adding new slot to PyTypeObject sets the bar too high. Try to use your 
function to speed up all cases mentioned in issue23507: sorted()/list.sort(), 
min() and max() with the key argument, filter(), map(), some iterators from 
itertools (groupby(), dropwhile(), takewhile(), accumulate(), filterfalse()), 
thin wrappers around special method (round(), math.floor(), etc). Use it in 
wrappers around PyObject_Call() like PyObject_CallFunctionObjArgs(). May be 
this will cause an effect even on some macrobenchmarks.

----------

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

Reply via email to