下表比較了Gruvi針對asyncio,gevent和eventlet的一些設計決策和功能。python
*socket
特徵 | Gruvi | Asyncio | Gevent | Eventlet |
---|---|---|---|---|
IO library(依賴包) | libuv | stdlib | libev | stdlib / libevent |
IO abstractionTransports/Protocols | Transports/ProtocolsGreen | sockets | Green sockets | reen sockets |
Threading | fibers | yield from | greenlet | greenlet |
Resolver | threadpool | threadpool | threadpool / c-ares | blocking/dnspython |
Python: 2.x | YES (2.7) | YES (2.6+, viaTrollius) | YES | YES |
Python: 3.x | YES (3.3+) | YES | NO | NO |
Python: PyPy | NO | NO | YES | YES |
Platform: Linux | FAST | FAST | FAST | FAST |
Platform: Mac OSX | FAST | FAST | FAST | FAST |
Platform: Windows | FAST (IOCP) | FAST (IOCP) | SLOW (select) | SLOW (select) |
SSL: Posix | FAST | FAST | FAST | FAST |
SSL: Windows | FAST (IOCP) | FAST (IOCP 3.5+) | SLOW (select) | SLOW (select) |
SSL: Contexts | YES (also Py2.7) | YES (also Py2.6+) | NO | NO |
HTTP | FAST (via http-parser) | NO (external) | SLOW (stdlib) | SLOW (stdlib) |
Monkey Patching | NO | NO | YES | YES |
print 123 import time x = time.time() print x