Skip to content

Commit

Permalink
Update benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ananto30 committed Jun 28, 2024
1 parent ae6585d commit eb5582c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 🗺

Expand Down
24 changes: 12 additions & 12 deletions benchmarks/dockerize/zero/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/dockerize/zero/gateway_sanic.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ 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")
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)
24 changes: 12 additions & 12 deletions benchmarks/local/zero/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/local/zero/gateway_sanic.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ 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")
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")
Expand Down

0 comments on commit eb5582c

Please sign in to comment.