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 _______________________________________________ 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