[Python-Dev] Python startup optimization: script vs. service
Gregory P. Smith
greg at krypto.org
Mon Oct 2 12:25:00 EDT 2017
On Mon, Oct 2, 2017 at 8:03 AM Victor Stinner <victor.stinner at gmail.com>
> 2017-10-02 16:48 GMT+02:00 Christian Heimes <christian at python.org>:
> > That approach could work, but I think that it is the wrong approach. I'd
> > rather keep Python optimized for long-running processes and introduce a
> > new mode / option to optimize for short-running scripts.
> "Filling caches on demand" is an old pattern. I don't think that we
> are doing anything new here.
> If we add an opt-in option, I would prefer to have an option to
> explicitly "fill caches", rather than the opposite.
+1 the common case benefits from the laziness.
The much less common piece of code that needs to pre-initialize as much as
possible to avoid work happening at an inopportune future time (prior to
forking, while handling latency sensitive real time requests yet still
being written in CPython, etc.) knows its needs and can ask for it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev