STINNER Victor <victor.stin...@haypocalc.com> added the comment:

I wrote bench_startup.py to measure the startup time on Windows. The precision 
of the script is quite bad because Windows timer has a bad resolution (e.g. 
15.6 ms on Windows 7) :-/

In release mode, the best startup time is 45.2 ms without random, 50.9 ms with 
random: an overhead of 5.6 ms (12%).

My script uses PYTHONHASHSEED=0 to disable the initialization of CryptoGen. You 
may modify the script to compare an unpatched Python with a patched Python for 
better numbers.

An overhead 12% is important. random-6.patch contains a faster (but also 
weaker) RNG on Windows, disable at compilation time. Search "#if 1" at the end 
of random.c. It uses my linear congruential generator (LCG) initialized with 
gettimeofday() and getpid() (which are known to be weak) instead of CryptoGen. 
Using the LCG, the startup overhead is between 1 and 2%.

----------
Added file: http://bugs.python.org/file24223/bench_startup.py

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

Reply via email to