From bad1b9da869b4e2192283741fec006594fc81a46 Mon Sep 17 00:00:00 2001 From: Channel Cat Date: Fri, 14 Oct 2016 20:06:29 -0700 Subject: [PATCH] Updated aiohttp benchmarks with uvloop --- README.md | 1 - tests/performance/aiohttp/simple_server.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/performance/aiohttp/simple_server.py diff --git a/README.md b/README.md index 4673f8e1..301df1a4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ All tests were run on a AWS medium instance running ubuntu, using 1 process. Ea | Sanic | Python 3.5 + uvloop | 29,128 | 3.40ms | | Falcon | gunicorn + meinheld | 18,972 | 5.27ms | | Flask | gunicorn + meinheld | 4,988 | 20.08ms | -| Aiohttp | Python 3.5 | 2,187 | 56.60ms | ## Hello World diff --git a/tests/performance/aiohttp/simple_server.py b/tests/performance/aiohttp/simple_server.py new file mode 100644 index 00000000..e8afce66 --- /dev/null +++ b/tests/performance/aiohttp/simple_server.py @@ -0,0 +1,17 @@ +# Run with python3 simple_server.py PORT + +from aiohttp import web +import asyncio +import sys +import uvloop + +loop = uvloop.new_event_loop() +asyncio.set_event_loop(loop) + +async def handle(request): + return web.json_response({"test":True}) + +app = web.Application(loop=loop) +app.router.add_route('GET', '/', handle) + +web.run_app(app, port=sys.argv[1])