This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients martin.panter, ncoghlan, serhiy.storchaka, vstinner
Date 2016-11-22.09:04:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1479805454.14.0.346654880765.issue28769@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-11-22 09:04:14vstinnersetrecipients: + vstinner, ncoghlan, martin.panter, serhiy.storchaka
2016-11-22 09:04:14vstinnersetmessageid: <1479805454.14.0.346654880765.issue28769@psf.upfronthosting.co.za>
2016-11-22 09:04:14vstinnerlinkissue28769 messages
2016-11-22 09:04:13vstinnercreate