[Python-Dev] this is what happens if you freeze all the modules required for startup

Giampaolo Rodola' g.rodola at gmail.com
Thu Apr 17 20:41:02 CEST 2014


On Thu, Apr 17, 2014 at 8:17 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> On Thu, 17 Apr 2014 18:09:22 +0000
> Brett Cannon <bcannon at gmail.com> wrote:
> > >
> > >    I would really love to have better startup times in production, but
> I
> > > would also really hate to lose the ability to hack around in stdlib
> > > sources during development just to get better startup performance.
> > >
> > >    In general, what I really like about using Python for software
> > > development is the ability to open any stdlib file and easily go poking
> > > around using stuff like 'import pdb;pdb.set_trace()' or simple print
> > > statements. Researching mysterious behaviour is generally much much
> > > MUCH! easier (read: takes less hours/days/weeks) if it ends up leading
> > > into a stdlib Python module than if it takes you down into the bowels
> of
> > > some C module (think zipimport.c *grin*). Not to mention the effect
> that
> > > being able to quickly resolve a mystery by hacking on some Python
> > > internals leaves you feeling very satisfied, while having to entrench
> > > yourself in those internals for a long time just to find out you've
> made
> > > something foolish on your end leaves you feeling exhausted at best.
> > >
> >
> > Freezing modules does not affect the ability to use gdb. And as long as
> you
> > set the appropriate __file__ values then tracebacks will contain even the
> > file line and location.
>
> I sympathize with Jurko's opinion. Being able to poke inside stdlib
> source files makes Python more approachable. I'm sure several of us got
> into Python that way.
>
> Regards
>
> Antoine.


I also wouldn't want that to be the default but Martin also suggested a -Z
cmdline option which sounds like an interesting idea to me.
...Or maybe simply use the existent -O option, which doesn't really
optimize much AFAIK.


-- 
Giampaolo - http://grodola.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140417/b8b5adf0/attachment.html>


More information about the Python-Dev mailing list