threading.py -> winthreading.c : Some results

Skip Montanaro skip at pobox.com
Fri Dec 21 09:23:57 EST 2001


    Boris> Jason Orendorff wrote:
    >> Condition.wait(timeout) runs 500x faster.

    Boris> Sounds like an oxymoron if it isn't one. Or a zen koan.

Unbeknownst to most people, time runs directly in a special hardware
register on most CPUs (check Appendix T of most CPU reference manuals).
Compiled languages can take advantage of this and generate much faster code
to check the current time.  Interpreted languages like Python are forced to
check the clock on the wall, so they timeout more slowly.

;-)

-- 
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)




More information about the Python-list mailing list