Message280261
Oh, I understood why I had issues to reproduce the startup performance slowdown. When Python is run from the source code using ./python, the re module is not imported. When Python is installed, the re is not imported by default neither:
haypo@speed-python$ prefix/bin/python3 -c 'import sys; print("re" in sys.modules)'
False
BUT when Python is started from a virtual environment (created by the "venv" module), the re module is important by default.
haypo@speed-python$ venv/bin/python3 -c 'import sys; print("re" in sys.modules)'
True
If the site module is not imported, the re module is not imported:
haypo@speed-python$ venv/bin/python3 -S -c 'import sys; print("re" in sys.modules)'
False
The /home/haypo/benchmarks/prefix/lib/python3.6/site.py file is generated by the venv module and contains:
def venv(...):
...
if candidate_confs:
import re
config_line = re.compile(CONFIG_LINE)
... |
|
Date |
User |
Action |
Args |
2016-11-07 23:38:35 | vstinner | set | recipients:
+ vstinner, gvanrossum, ned.deily, ethan.furman |
2016-11-07 23:38:35 | vstinner | set | messageid: <1478561915.6.0.220678128256.issue28637@psf.upfronthosting.co.za> |
2016-11-07 23:38:35 | vstinner | link | issue28637 messages |
2016-11-07 23:38:35 | vstinner | create | |
|