Slide 31
Slide 31 text
PyPy STM
10 loops, best of 3: 1.2 sec per loop
10 loops, best of 3: 822 msec per loop
from threading import Thread
def count(n):
while n > 0:
n -= 1
def run():
t1 = Thread(target=count, args=(10000000,))
t1.start()
t2 = Thread(target=count, args=(10000000,))
t2.start()
t1.join(); t2.join()
def count(n):
while n > 0:
n -= 1
def run():
count(10000000)
count(10000000)
Inside the Python GIL - David Beazley