[issue25159] Regression in time to import a module

2015-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, importing 4 additional modules can be a cause of the slowdown. Thanks Victor. -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker

[issue25159] Regression in time to import a module

2015-10-15 Thread STINNER Victor
STINNER Victor added the comment: $ 3.4/python -c "import sys; sys.modules.clear(); import enum; print(len(sys.modules))" 18 $ 3.5/python -c "import sys; sys.modules.clear(); import enum; print(len(sys.modules))" 22 -- ___ Python tracker

[issue25159] Regression in time to import a module

2015-10-15 Thread STINNER Victor
STINNER Victor added the comment: Importing a module looks slow to me. Importing a module which is a an *empty* .py file takes ~160 us. $ python3 -I -m timeit -s "open('slow.py', 'wb').close(); import sys; import slow" "del sys.modules['slow']; import slow" 1 loops, best of 3: 156 usec per

[issue25159] Regression in time to import a module

2015-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I just have rebuilt my Python's in development brances after made distclean to avoid possible effects of incremental building, and got the same results. (1) for i in `seq 5`; do ./python -I -m timeit -n1 -r1 -s "import sys; sys.modules.clear()" -- "import en

[issue25159] Regression in time to import a module

2015-09-22 Thread STINNER Victor
STINNER Victor added the comment: I tested on Linux. (1) for i in `seq 5`; do ./python -I -m timeit -n1 -r1 -s "import sys; sys.modules.clear()" -- "import enum"; done (shortest timing) Python 3.4: 6.93 msec Python 3.6: 7.05 msec (+2%) (2) for i in `seq 5`; do ./python -I -m timeit "import

[issue25159] Regression in time to import a module

2015-09-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: I did not find any significant different between 3.4 and 3.5 on Windows running the following: import os, time from importlib import import_module files = os.listdir("C:/Programs/Python34/Lib") excludes = {'antigravity.py', 'compileall.py', 'crypt.py', 'pty.py

[issue25159] Regression in time to import a module

2015-09-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Clarify title; regression is not in 'import time'. I am working on timing the import of Lib/*.py on windows. I already discovered that unix-only crypt is present on windows (but should not be). -- nosy: +terry.reedy title: Import time regression -> Re