[Python-Dev] Investigating time for `import requests`
Stéfane Fermigier
sf at fermigier.com
Tue Oct 3 06:18:04 EDT 2017
Hi,
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.
S.
--
Stefane Fermigier - http://fermigier.com/ - http://twitter.com/sfermigier -
http://linkedin.com/in/sfermigier
Founder & CEO, Abilian - Enterprise Social Software -
http://www.abilian.com/
Chairman, Free&OSS Group / Systematic Cluster -
http://www.gt-logiciel-libre.org/
Co-Chairman, National Council for Free & Open Source Software (CNLL) -
http://cnll.fr/
Founder & Organiser, PyData Paris - http://pydata.fr/
---
“You never change things by fighting the existing reality. To change
something, build a new model that makes the existing model obsolete.” — R.
Buckminster Fuller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171003/64c5b416/attachment.html>
More information about the Python-Dev
mailing list