Skip to content

Commit

Permalink
Merge pull request #79 from linnik/uvloop
Browse files Browse the repository at this point in the history
add uvloop benchmark
  • Loading branch information
asvetlov committed Nov 1, 2016
2 parents ddae5d7 + 6615b6a commit 2cb2c08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion benchmarks/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import threading
import time
import zmq
import uvloop

from scipy.stats import norm, tmean, tvar, tstd
from numpy import array, arange
Expand Down Expand Up @@ -154,10 +155,20 @@ def connection_lost(self, exc):
self.on_close.set_result(exc)


def test_core_aiozmq_uvloop(count):
"""core aiozmq with uvloop"""
loop = uvloop.new_event_loop()
return _test_core_aiozmq(count, loop)


def test_core_aiozmq_loopless(count):
"""core aiozmq loopless"""
print('.', end='', flush=True)
loop = asyncio.new_event_loop()
return _test_core_aiozmq(count, loop)


def _test_core_aiozmq(count, loop):
print('.', end='', flush=True)

@asyncio.coroutine
def go():
Expand Down Expand Up @@ -273,6 +284,7 @@ def go():
avail_tests = {f.__name__: f for f in [test_raw_zmq, test_zmq_with_poller,
test_aiozmq_rpc,
test_core_aiozmq_legacy,
test_core_aiozmq_uvloop,
test_core_aiozmq_loopless,
test_zmq_with_thread]}

Expand Down
1 change: 1 addition & 0 deletions requirements-bench.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
matplotlib==1.5.3
scipy>=0.13.3
numpy>=1.8.1
uvloop>=0.5.4
-r requirements.txt

0 comments on commit 2cb2c08

Please sign in to comment.