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 Demur Rumed, amper, benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, vstinner, yselivanov
Date 2016-04-09.13:19:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460207954.78.0.355987417051.issue26722@psf.upfronthosting.co.za>
In-reply-to
Content
> Do you have any numbers on how common constant comparisons are in real code?

In my experience, it almost never occur in real application. But it's common when you start with a constant propogation optimization:

* https://faster-cpython.readthedocs.org/optimizations.html#constant-propagation
* https://fatoptimizer.readthedocs.org/en/latest/optimizations.html#constant-propagation

If you extend constant propagation to things like os.name, it's even more common, but it requires to specialize the code, to disable optimization if os.name is modified (that's one feature provided by FAT Python).
History
Date User Action Args
2016-04-09 13:19:14vstinnersetrecipients: + vstinner, brett.cannon, georg.brandl, ncoghlan, benjamin.peterson, yselivanov, Demur Rumed, amper
2016-04-09 13:19:14vstinnersetmessageid: <1460207954.78.0.355987417051.issue26722@psf.upfronthosting.co.za>
2016-04-09 13:19:14vstinnerlinkissue26722 messages
2016-04-09 13:19:14vstinnercreate