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

Jurko Gospodnetić jurko.gospodnetic at pke.hr
Thu Apr 17 20:23:52 CEST 2014


   Hi.

On 17.4.2014. 19:57, Guido van Rossum wrote:
> On Thu, Apr 17, 2014 at 10:33 AM, Jurko Gospodnetić
> <jurko.gospodnetic at pke.hr <mailto:jurko.gospodnetic at pke.hr>> wrote:
>
>        I would really love to have better startup times in production,
>
> What's your use case? I understand why startup time is important for Hg,
> but I'd like to understand what other situations occur frequently enough
> to worry about it.

   The first one that pops to mind is scripting when automating 
different system administration tasks.

   When you automate something that ends up calling lots of different 
Python scripts - the startup times add up. Yes, I know you can update 
the system so that the scripts get called inside a single Python 
process, but that often requires major refactoring, e.g.:
   - you have to refactor those scripts to be importable while they were 
originally prepared to be used as 'stand-alone executables'
   - you either have to use Python as your external automation tool or 
you need to implement some sort of a Python based tool runner daemon process

   Another example is the speed at which some automated test suits run 
that need to call external Python scripts. Such suites often call 
thousands of such scripts so their startup times add up to such numbers 
that Python gets a bad rep. And shaving off unnecessarily wasted seconds 
or minutes in a test suite is always good, as it speeds up the whole 
develop/test cycle. :-)

   I've been in situations where I got a request to 'convert those 
Python scripts to batch files so they would run faster'. :-) And, while 
I really love Python as a development language, simple scripts 
implemented in it often do make the system feel kind of sluggish. :-(

   And with that in mind, the effect of systems becoming 'even more 
sluggish' when upgrading them to use the new 'Python 3' version, even if 
that slowdown is not all startup related, often comes as an additional 
slap in the face. :-(

   Best regards,
     Jurko Gospodnetić



More information about the Python-Dev mailing list