Those two libraries share the similar philosophy and the similar design decisions as a result. But this popular WSGI benchmark says eventlet is way slower than gevent. What do make their performance so different?
As I know key differences between them are:
geventintentionally depends on and is coupled tolibev(libevent, previously) whileeventletdefines independent reactor interface and implements particular adapters usingselect,epoll, and Twisted reactor behind it. Does additional reactor interface make critical performance hits?geventis mostly written in Cython whileeventletis written in pure Python. Is natively compiled Cython so faster than pure Python, for not-so-much-computational but IO-bound programs?Primitives of
geventemulate standard libraries’ interfaces whileeventlet’s primitives differ from standard and provides additional layer to emulate it. Does additional emulation layer makeseventletslower?Is the implementation of
eventlet.wsgijust worse thangevent.pywsgi?
I really wonder, because they overall look so similar for me.