Join GitHub today
Speed up Greenlet creation on CPython #1120
Two ways: store tuples instead of _frame objects and use direct access
CPython 2.7 master vs this change
Not significant (7): eventlet spawn; geventraw spawn; geventraw sleep;
CPython 3.6 master vs this change
Not significant (9): eventlet spawn; eventlet sleep; geventraw spawn;
PyPy2 master vs this change
Not significant (1): geventpool sleep
CPython 3.6: 1.3a1 vs this change
Not significant (4): eventlet sleep; none spawn; eventlet spawn kwarg; none spawn kwarg
The eventlet, sleep, join and raw tests serve as controls, so we can see that there's up to ~10% variance between most runs anyway.
CPython 3.6 shows the least variance so those 10-20% improvement numbers are probably fairly close.
PyPy sadly gets slower with this change for reasons that are utterly unclear.
Compared to 1.3a1 (last benchmark) we're still up to 2-3x slower.
Creation of a raw greenlet shows 2.66us on CPython 3.6.4 vs the 3.65us reported in #755.