The numbers claimed by this benchamark about Gevent [1] comparaed with the numbers got by Asyncio with the uvloop
and even with the default loop has left me a bit frozen. Ive repeated a few of them : gevent, asyncio, asyncio-uvloop and go for
the echo server and these are the numbers roughly:
For gevent
$ ./echo_client
685393 0.98KiB messages in 30 seconds
Latency: min 0.04ms; max 4.48ms; mean 0.126ms; std: 0.048ms (37.68%)
Latency distribution: 25% under 0.088ms; 50% under 0.122ms; 75% under 0.158ms; 90% under 0.182ms; 99% under 0.242ms; 99.99% under 0.91ms
Requests/sec: 22846.43
Transfer/sec: 21.79MiB
For asyncio
$ ./echo_client
286039 0.98KiB messages in 30 seconds
Latency: min 0.04ms; max 2.51ms; mean 0.309ms; std: 0.074ms (23.85%)
Latency distribution: 25% under 0.286ms; 50% under 0.304ms; 75% under 0.328ms; 90% under 0.378ms; 99% under 0.514ms; 99.99% under 1.489ms
Requests/sec: 9534.63
Transfer/sec: 9.09MiB
For asyncio-uvloop
$ ./echo_client
617248 0.98KiB messages in 30 seconds
Latency: min 0.04ms; max 9.32ms; mean 0.141ms; std: 0.057ms (40.76%)
Latency distribution: 25% under 0.1ms; 50% under 0.13ms; 75% under 0.174ms; 90% under 0.218ms; 99% under 0.279ms; 99.99% under 1.099ms
Requests/sec: 20574.93
Transfer/sec: 19.62MiB
For go:
$ ./echo_client
1341627 0.98KiB messages in 30 seconds
Latency: min 0.03ms; max 16.46ms; mean 0.061ms; std: 0.039ms (63.55%)
Latency distribution: 25% under 0.051ms; 50% under 0.058ms; 75% under 0.067ms; 90% under 0.077ms; 99% under 0.118ms; 99.99% under 1.147ms
Requests/sec: 44720.9
Transfer/sec: 42.65MiB
The CPU system used is :
Processor Name: Intel Core i5
Processor Speed: 2.9 GHz
Number of Processors: 1
Total Number of Cores: 2
And Python version + packages
$ python --version
Python 3.5.1
$ pip freeze
gevent==1.1.1
greenlet==0.4.9
numpy==1.11.0
pyuv==1.2.0
uvent==0.3.0
uvloop==0.4.11
wheel==0.24.0
[1] http://magic.io/blog/uvloop-make-python-networking-great-again/