STINNER Victor added the comment:

Original:

$ ./python -S -m timeit -s 'import sys' 'import keyword; keyword=None; del 
sys.modules["keyword"]'
10000 loops, best of 3: 149 usec per loop

Python patched with  keyword_grammar.patch:

$ ./python -S -m timeit -s 'import sys' 'import keyword; keyword=None; del 
sys.modules["keyword"]'
10000 loops, best of 3: 20 usec per loop


The gain is 129 microseconds (import 7.4x faster). Python starts in between 
8,850 and 13,800 microseconds on my PC:


$ ./python -S -m timeit -s 'import subprocess; args=[sys.executable, "-S", 
"-c", "pass"]' 'subprocess.call(args)'
100 loops, best of 3: 8.85 msec per loop

$ ./python -S -m timeit -s 'import subprocess; args=[sys.executable, "-c", 
"pass"]' 'subprocess.call(args)'
100 loops, best of 3: 13.8 msec per loop

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19230>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to