diff --git a/README.md b/README.md index 0264d38..df08409 100644 --- a/README.md +++ b/README.md @@ -253,8 +253,8 @@ aiohttp | 14391.38 | 10.96 | 9470.74 | 12 aiozmq | 15121.86 | 9.42 | 5904.84 | 21.57 fastApi | 9590.96 | 18.31 | 6669.81 | 24.41 sanic | 18790.49 | 8.69 | 12259.29 | 13.52 -zero(sync) | 24805.61 | 4.57 | 16498.83 | 7.80 -zero(async) | 22716.84 | 5.61 | 17446.19 | 7.24 +zero(sync) | 27842.80 | 4.34 | 18401.14 | 6.58 +zero(async) | 27958.60 | 3.55 | 20131.83 | 6.21 # Roadmap 🗺 diff --git a/benchmarks/dockerize/zero/docker-compose.yaml b/benchmarks/dockerize/zero/docker-compose.yaml index 1f9b4b2..77238c8 100755 --- a/benchmarks/dockerize/zero/docker-compose.yaml +++ b/benchmarks/dockerize/zero/docker-compose.yaml @@ -2,27 +2,27 @@ version: '3' services: # aiohttp gateway - gateway: - build: . - container_name: gateway - command: gunicorn gateway_aiohttp:app --bind 0.0.0.0:8000 --worker-class aiohttp.worker.GunicornWebWorker --workers 8 --log-level warning - ports: - - "8000:8000" - depends_on: - - server - - redis - - # sanic gateway # gateway: # build: . # container_name: gateway - # command: sanic gateway_sanic:app --host 0.0.0.0 --port 8000 --workers 8 --no-access-logs + # command: gunicorn gateway_aiohttp:app --bind 0.0.0.0:8000 --worker-class aiohttp.worker.GunicornWebWorker --workers 8 --log-level warning # ports: # - "8000:8000" # depends_on: # - server # - redis + # sanic gateway + gateway: + build: . + container_name: gateway + command: sanic gateway_sanic:app --host 0.0.0.0 --port 8000 --workers 8 --no-access-logs + ports: + - "8000:8000" + depends_on: + - server + - redis + server: build: . container_name: server diff --git a/benchmarks/dockerize/zero/gateway_sanic.py b/benchmarks/dockerize/zero/gateway_sanic.py index 171662d..7127f34 100644 --- a/benchmarks/dockerize/zero/gateway_sanic.py +++ b/benchmarks/dockerize/zero/gateway_sanic.py @@ -36,7 +36,7 @@ async def async_hello(request): @app.route("/order") async def order(request): resp = client.call("save_order", {"user_id": "1", "items": ["apple", "python"]}) - return json(await resp.json()) + return json(resp) @app.route("/async_order") @@ -44,17 +44,17 @@ async def async_order(request): resp = await async_client.call( "save_order", {"user_id": "1", "items": ["apple", "python"]} ) - return json(await resp.json()) + return json(resp) @app.route("/jwt") async def enc_dec_jwt(request): resp = await async_client.call("decode_jwt", {"user_id": "a1b2c3"}) - return json(await resp.json()) + return json(resp) @app.route("/echo") async def echo(request): big_list = ["hello world" for i in range(100_000)] resp = await async_client.call("echo", big_list) - return text(await resp.text()) + return text(resp) diff --git a/benchmarks/local/zero/docker-compose.yaml b/benchmarks/local/zero/docker-compose.yaml index 1f9b4b2..77238c8 100755 --- a/benchmarks/local/zero/docker-compose.yaml +++ b/benchmarks/local/zero/docker-compose.yaml @@ -2,27 +2,27 @@ version: '3' services: # aiohttp gateway - gateway: - build: . - container_name: gateway - command: gunicorn gateway_aiohttp:app --bind 0.0.0.0:8000 --worker-class aiohttp.worker.GunicornWebWorker --workers 8 --log-level warning - ports: - - "8000:8000" - depends_on: - - server - - redis - - # sanic gateway # gateway: # build: . # container_name: gateway - # command: sanic gateway_sanic:app --host 0.0.0.0 --port 8000 --workers 8 --no-access-logs + # command: gunicorn gateway_aiohttp:app --bind 0.0.0.0:8000 --worker-class aiohttp.worker.GunicornWebWorker --workers 8 --log-level warning # ports: # - "8000:8000" # depends_on: # - server # - redis + # sanic gateway + gateway: + build: . + container_name: gateway + command: sanic gateway_sanic:app --host 0.0.0.0 --port 8000 --workers 8 --no-access-logs + ports: + - "8000:8000" + depends_on: + - server + - redis + server: build: . container_name: server diff --git a/benchmarks/local/zero/gateway_sanic.py b/benchmarks/local/zero/gateway_sanic.py index 171662d..bd0dc82 100644 --- a/benchmarks/local/zero/gateway_sanic.py +++ b/benchmarks/local/zero/gateway_sanic.py @@ -36,7 +36,7 @@ async def async_hello(request): @app.route("/order") async def order(request): resp = client.call("save_order", {"user_id": "1", "items": ["apple", "python"]}) - return json(await resp.json()) + return json(resp) @app.route("/async_order") @@ -44,7 +44,7 @@ async def async_order(request): resp = await async_client.call( "save_order", {"user_id": "1", "items": ["apple", "python"]} ) - return json(await resp.json()) + return json(resp) @app.route("/jwt")