[issue15038] Optimize python Locks on Windows

Paul Moore report at bugs.python.org
Tue Jun 12 14:56:11 CEST 2012


Paul Moore <p.f.moore at gmail.com> added the comment:

Applies and builds cleanly on Win7 32-bit. The speed difference is visible here too:

PS D:\Data\cpython\PCbuild> .\python.exe -m timeit -s "from _thread import allocate_lock; l=allocate_lock()" "l.acquire();l.release()"
1000000 loops, best of 3: 0.608 usec per loop
PS D:\Data\cpython\PCbuild> hg revert --all
reverting pythoncore.vcxproj
reverting pythoncore.vcxproj.filters
reverting ..\Python\ceval_gil.h
forgetting ..\Python\condvar.h
reverting ..\Python\thread_nt.h
PS D:\Data\cpython\PCbuild> .\python.exe -m timeit -s "from _thread import allocate_lock; l=allocate_lock()" "l.acquire();l.release()"
1000000 loops, best of 3: 1.66 usec per loop

The test suite had a few Python crashes, but a build of trunk did too. No time to diagnose these now, but I didn't see any failures that weren't also in the unpatched build.

Basically, test suite results look the same as for the unpatched build.

----------
nosy: +pmoore

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15038>
_______________________________________


More information about the Python-bugs-list mailing list