[Python-Dev] More optimisation ideas (original) (raw)

Steve Dower steve.dower at python.org
Sat Jan 30 14:15:26 EST 2016


Brett tried freezing the entire stdlib at one point (as we do for parts of importlib) and reported no significant improvement. Since that rules out code compilation as well as the OS calls, it'd seem the priority is to execute less code on startup.

Details of that work were posted to python-dev about twelve months ago, IIRC. Maybe a little longer.

Top-posted from my Windows Phone

-----Original Message----- From: "Serhiy Storchaka" <storchaka at gmail.com> Sent: ‎1/‎30/‎2016 10:22 To: "python-dev at python.org" <python-dev at python.org> Subject: Re: [Python-Dev] More optimisation ideas

On 30.01.16 18:31, Steve Dower wrote:

On 30Jan2016 0645, Serhiy Storchaka wrote:

$ ./python -m timeit -s "import codecs; from encodings.cp437 import decodingtable" -- "codecs.charmapbuild(decodingtable)" 100000 loops, best of 3: 4.36 usec per loop

Getting rid from charmapbuild() would save you at most 4.4 microseconds per encoding. 0.0005 seconds if you have imported all standard encodings! Just as happy to be proven wrong. Perhaps I misinterpreted my original profiling and then, embarrassingly, ran with the result for a long time without retesting.

AFAIK the most time is spent in system calls like stat or open. Archiving the stdlib into the ZIP file and using zipimport can decrease Python startup time (perhaps there is an open issue about this).


Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/steve.dower%40python.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20160130/f9357a58/attachment.html>



More information about the Python-Dev mailing list