On Fri, Jun 10, 2022 at 09:59:36PM -0500, James Johnson wrote:
> I guess I was jumping to conclusions. Thank you for taking the time to look
> at my email.
> 
> I apologize if I wasted your time.

No stress -- opening issues up for discussion is not a waste of time.

This would be a good time to mention that there have been previous 
requests to have more control of what optimizations the Python byte-code 
compiler performs, mostly for the benefit of profiling applications.

While the compiler doesn't do many, or any, large complex optimizations 
like a C compiler may do, it does do some keyhole optimizations. 
Sometimes those keyhole optimizations interfere with the ability of 
programs to analyse Python code and report on code coverage.

While the keyhole optimization doesn't change the semantics of the code, 
it does change the structure of it, and makes it harder to analyse 
whether or not each clause in a statement is covered by tests.

So other people have also requested the ability to tell the compiler to 
turn off all optimizations.

Another factor is that as we speak, Mark Shannon is doing a lot of work 
on optimization for the CPython byte-code compiler, including adding JIT 
compilation techniques. (PyPy has had this ability for many years.) So 
it is possible that future compiler optimizations may start to move into 
the same areas that C/C++ compiler optimizations take, possibly even 
changing the meaning of code.

It would be good to plan ahead, and start considering more fine grained 
optimization control, rather than the underpowered -O and -OO flags we 
have now.


-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/T3YBQRFVSQUJ2O6R6ON5ZTN77A6XGSZK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to