[Python-ideas] Disable all peephole optimizations
Stefan Behnel
stefan_ml at behnel.de
Thu May 22 21:11:46 CEST 2014
Brett Cannon, 21.05.2014 15:51:
> There are constant rumblings about trying to make .pyc/.pyo aware of what
> optimizations were applied so that this kind of thing wouldn't occur. It
> would require tweaking how optimizations are expressed/added so that they
> are more easily controlled and can somehow contribute to the labeling of
> what optimizations were applied. All totally doable but will require
> thinking about the proper API and such (reading .pyc/.pyo files would also
> break but that's happened before when we added file size to the header and
> .pyc/.pyo files are viewed as internal optimizations anyway).
It might be possible to move the peephole optimiser run into the code
loader, i.e. the .pyc files could be written out *before* it runs, as plain
unoptimised byte code. There might be a tiny performance impact on load,
but I doubt that it would be serious.
Stefan
More information about the Python-ideas
mailing list