[Python-Dev] GIL behaviour under Windows (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Wed Oct 21 19:55:26 CEST 2009


Le mercredi 21 octobre 2009 à 12:42 -0500, John Arbash Meinel a écrit :

You can use time.clock() instead to get <15ms resolution. Changing all instances of 'time.time' to 'time.clock' gives me this result: [snip] --- Latency --- Background CPU task: Pi calculation (Python) CPU threads=0: 24727 ms. (std dev: 0 ms.) CPU threads=1: 27930 ms. (std dev: 0 ms.) CPU threads=2: 31029 ms. (std dev: 0 ms.) CPU threads=3: 34170 ms. (std dev: 0 ms.) CPU threads=4: 37292 ms. (std dev: 0 ms.)

Well apparently time.clock() has a per-process time reference, which makes it unusable for this benchmark :-( (the numbers above are obviously incorrect)

Regards

Antoine.



More information about the Python-Dev mailing list