[Python-Dev] Investigating time for `import requests`
sf at fermigier.com
Tue Oct 3 06:18:04 EDT 2017
On Mon, Oct 2, 2017 at 11:42 AM, Raymond Hettinger <
raymond.hettinger at gmail.com> wrote:
> I don't expect to find anything that would help users of Django, Flask,
> and Bottle since those are typically long-running apps where we value
> response time more than startup time.
Actually, as web developers, we also value startup time when in development
mode, specially when we are in "hot reload" mode (when the app restarts
automatically each time we save a development file).
In my mid-sized projects (~10 kE LOC, ~150 pip dependencies) it takes
between 5 and 10s. This is probably the upper limit to "stay in flow".
Same for unit tests.
There is this famous Gary Bernhardt talk [https://youtu.be/RAxiiRPHS9k?t=12m
] he argues that a whole unit test suite should be able to run in < 1s and
actually show examples where the developer is able to run hundreds of tests
in less that 1s.
Note: In my projects, it take 3-4 seconds just to collect them (using
pytest --collect-only), but I suspect Python's startup time is only
responsible for a small part of this delay. Still, this is an important
point to keep in mind.
Stefane Fermigier - http://fermigier.com/ - http://twitter.com/sfermigier -
Founder & CEO, Abilian - Enterprise Social Software -
Chairman, Free&OSS Group / Systematic Cluster -
Co-Chairman, National Council for Free & Open Source Software (CNLL) -
Founder & Organiser, PyData Paris - http://pydata.fr/
“You never change things by ﬁghting the existing reality. To change
something, build a new model that makes the existing model obsolete.” — R.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev