[Python-ideas] Disabling optimizations

Brett Cannon bcannon at gmail.com
Fri May 23 14:27:26 CEST 2014


On Fri May 23 2014 at 6:03:59 AM, Antoine Pitrou <solipsis at pitrou.net>
wrote:

> On Fri, 23 May 2014 07:28:32 +0200
> Stefan Behnel <stefan_ml at behnel.de> wrote:
> > >
> > > As I already proposed, we could get rid of .pyo files all together and
> only
> > > write unoptimised .pyc files, and then apply the optimisations at load
> time
> > > based on the current interpreter config. I think that would give us a
> good
> > > tradeoff between fast (precompiled) code loading and differing
> requirements
> > > on byte code optimisations.
> >
> > Stefan Krah already proposed -Os (optimise for space) for the cases where
> > you want to reduce the size of the byte code file, e.g. by removing doc
> > strings. That could become the next .pyo file. Although it's unclear to
> me
> > why you would do that, instead of just compressing them.
>
> People who are really short on disk space (embedded devs?) probably do
> both: first strip docstrings and friends, then compress.
>

.pyo files also use less memory once loaded as well. -OO is definitely not
going away as at least an available option under some name.

-Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140523/7b7e7bb9/attachment.html>


More information about the Python-ideas mailing list