On Wednesday, September 6, 2017, INADA Naoki <songofaca...@gmail.com> wrote:
> > How significant is application startup time to something that uses > > Jinja2? Are there short-lived programs that use it? Python startup > > time matters enormously to command-line tools like Mercurial, but far > > less to something that's designed to start up and then keep running > > (eg a web app, which is where Jinja is most used). > > Since Jinja2 is very popular template engine, it is used by CLI tools > like ansible. SaltStack uses Jinja2. It really is a good idea to regularly restart the minion processes. Celery can also cycle through worker processes, IIRC. > > Additionally, faster startup time (and smaller memory footprint) is good > for even Web applications. > For example, CGI is still comfortable tool sometimes. > Another example is GAE/Python. Short-lived processes are sometimes preferable from a security standpoint. Python is currently less viable for CGI use than other scripting languages due to startup time. Resource leaks (e.g. memory, file handles, database references; valgrind) do not last w/ short-lived CGI processes. If there's ASLR, that's also harder. Scale up operations with e.g. IaaS platforms like Kubernetes and PaaS platforms like AppScale all incur Python startup time on a regular basis. > > Anyway, I think researching import tree of popular library is good > startline > about optimizing startup time. > For example, modules like ast and tokenize are imported often than I > thought. > > Jinja2 is one of libraries I often use. I'm checking other libraries > like requests. > Thanks, > > INADA Naoki <songofaca...@gmail.com <javascript:;>> > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org <javascript:;> > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > wes.turner%40gmail.com >
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com