A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-October/129369.html below:

[Python-Dev] Python startup time

[Python-Dev] Python startup time [Python-Dev] Python startup timeChristian Heimes christian at python.org
Thu Oct 10 14:25:18 CEST 2013
Am 10.10.2013 06:41, schrieb yoav glazner:
> I'm not sure Droping imports is the best way to go, since every python
> script/app will import common modules right on the start and it will
> still seem like the interpeter boot is slow.
> 
> making modules load faster seems like a better approch

Not every script uses the re or collections module. Especially short
running and simple Python programs suffer from import overuse. Every
imported module adds extra syscalls and IO, too. These are costly
operations, especially on slow or embedded devices.


Benchmark of 1000 times "python -c ''"

Python 3.4dev with all my experimental patches:

  Avg: 0.705161 -> 0.443613: 1.59x faster

2.7 -> 3.4dev:

  Avg: 0.316177 -> 0.669330: 2.12x slower

2.7 -> 3.4dev with all my patches:

  Avg: 0.314879 -> 0.449556: 1.43x slower

http://pastebin.com/NFrpa7Jh

Ain't bad! The benchmarks were conducted on a fast 8 core machine with SSD.

Christian


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4