Raymond Hettinger added the comment:

I think the source in listobject.c would be benefit from a well-named macro for 
this.  That would provide the most clarity.   For deques, I'll just put in the 
simple patch because it only applies to a place that is already doing unsigned 
arithmetic/comparisons.

FWIW, I don't usually use benchmarking on these kinds of changes.  The 
generated assembler is sufficiently informative.   Benchmarking each tiny 
change risks getting trapped in a local minimum.  Also, little timeit tests 
tend to branch the same way every time (which won't show the cost of prediction 
misses) and it tends to have all code and data in cache (so you don't see the 
effects of cache misses) and it risks tuning to a single processor (in my case 
a haswell).   Instead, I look at the code generated by GCC and CLang to see 
that it does less work.

----------

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

Reply via email to