[issue7946] Convoy effect with I/O bound threads and New GIL
report at bugs.python.org
Wed Feb 17 04:00:39 CET 2010
Antoine Pitrou <pitrou at free.fr> added the comment:
Just a quick test under Linux (on a dual quad core machine):
- with iotest.py and echo_client.py both running Python 2.7: 25.562 seconds (410212.450 bytes/sec)
- with iotest.py and echo_client.py both running Python 3.2: 28.160 seconds (372362.459 bytes/sec)
As already said, the "spinning endlessly" loop is a best case for thread switching latency in 2.x, because the opcodes are very short. If each opcode in the loop has an average duration of 20 ns, and with the default check interval of 100, the GIL gets speculatively released every 2 us (yes, microseconds). That's why I suggested trying more "realistic" workloads, as in ccbench.
Also, as I told you, there might also be interactions with the various timing heuristics the TCP stack of the kernel applies. It would be nice to test with UDP.
That said, the observations are interesting.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list