STINNER Victor added the comment:

Hum, sorry, my opinion on const is not obvious in my previous message: I like 
const :-) I want to use const everywhere! I still "believe" (I don't know if 
it's true or not) that const helps a lot compilers to optimize the code.

I don't know if it helps for a single variable. Maybe it's more helpful on a 
whole structure and/or pointers to avoid complex heuristics on aliasing.

My first attempt to design the _PyBytesWriter API was a big mistake: it was 
much slower: issue #17742. I understood that using a structure instead of 
multiple variables does stress the compiler who doesn't know if some 
optimizations are still save. In case of doubt, the compiler doesn't optimize 
to avoid generating invalid code.

----------

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

Reply via email to