summaryrefslogtreecommitdiff
path: root/benchmarks/context.py
diff options
context:
space:
mode:
authorSergey Shepelev <temotor@gmail.com>2018-02-17 22:41:37 +0300
committerSergey Shepelev <temotor@gmail.com>2018-03-11 02:21:01 +0300
commitfb300387a2f2761423dc71b3e4d18cb26a360368 (patch)
tree0dad33d1bf722f8701c5b919d658d3f559c06912 /benchmarks/context.py
parent8fe75a76e773305f9748e3922aaf44bf4c39a939 (diff)
downloadeventlet-up.tar.gz
hubs: drop pyevent hubup
Diffstat (limited to 'benchmarks/context.py')
-rw-r--r--benchmarks/context.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/benchmarks/context.py b/benchmarks/context.py
index d9b564d..139726e 100644
--- a/benchmarks/context.py
+++ b/benchmarks/context.py
@@ -5,8 +5,7 @@ import threading
import time
import eventlet
-from eventlet import hubs
-from eventlet.hubs import pyevent, epolls, poll, selects
+import eventlet.hubs
CONTEXT_SWITCHES = 100000
@@ -65,23 +64,23 @@ test_thread()
print("threading: %.02f seconds" % (time.time() - start))
try:
- hubs.use_hub(pyevent)
+ eventlet.hubs.use_hub('eventlet.hubs.epolls')
start = time.time()
test_eventlet()
- print("pyevent: %.02f seconds" % (time.time() - start))
+ print("epoll: %.02f seconds" % (time.time() - start))
except:
- print("pyevent hub unavailable")
+ print("epoll hub unavailable")
try:
- hubs.use_hub(epolls)
+ eventlet.hubs.use_hub('eventlet.hubs.kqueue')
start = time.time()
test_eventlet()
- print("epoll: %.02f seconds" % (time.time() - start))
+ print("kqueue: %.02f seconds" % (time.time() - start))
except:
- print("epoll hub unavailable")
+ print("kqueue hub unavailable")
try:
- hubs.use_hub(poll)
+ eventlet.hubs.use_hub('eventlet.hubs.poll')
start = time.time()
test_eventlet()
print("poll: %.02f seconds" % (time.time() - start))
@@ -89,7 +88,7 @@ except:
print("poll hub unavailable")
try:
- hubs.use_hub(selects)
+ eventlet.hubs.use_hub('eventlet.hubs.selects')
start = time.time()
test_eventlet()
print("select: %.02f seconds" % (time.time() - start))