Calculate with MapReduce pattern: how many times has the word aardvark
appeared in literature since 1500 in the Google Books Ngram Dataset.
Language | Description | Duration, sec |
---|---|---|
python |
asyncio + ProcessPoolWorker (16 processes) | 22 |
go |
16 gorutines | 5 |
All Web API servers & skeletons are tested by WRK benchmark tool.
Default command for verification:
wrk -t12 -c400 -d30s http://localhost:{port}/
- t12 -- 12 threads
- c400 -- 400 connections
- 30s -- test in 30 seconds
Tool | Description | Benchmark values, req/sec | Comparing with min |
---|---|---|---|
Flask + gunicorn |
8 workers (processes) | 18774 | + 955% |
aiohttp |
default, 1 thread | 12600 | + 641 % |
aiohttp + gunicorn |
1 worker (process) | 23037 | + 1172% |
aiohttp + gunicorn |
8 workers (processes) | 94071 | + 4789% |
FastAPI + uvicorn |
1 worker (process) | 1964 | 0 |
FastAPI + uvicorn |
8 workers (processes) | 9518 | + 484% |
starlette + uvicorn |
1 worker (process) | 3814 | + 194% |
starlette + uvicorn |
8 worker (processes) | 15080 | + 804% |
For default use all 16 threads
Tool | Description | Benchmark values, req/sec | Comparing, % |
---|---|---|---|
net/http |
- | 285423 | + 774% |
fasthttp |
- | 414538 | + 1124% |
gin |
ReleaseMode + Logs + JSON Answer | 65424 | + 177% |
echo |
with Logger middleware | 36848 | 0% |
echo |
without Logger middleware | 326130 | + 885% |
fiber |
- | 508505 | + 1380% |
aero |
- | 342943 | + 930% |
Tool | Description | Benchmark values | Comparing, % |
---|---|---|---|
Boost Beast |
None | - | - |
drogon |
None | - | - |
POCO |
None | - | - |
cpprestsdk |
None | - | - |
self-made tcp server |
None | - | - |
In this section benchmark consists of 10000 requests to 1-thread aiohttp server on local machine.
Tool | Description | Benchmark values, sec | Comparing, % |
---|---|---|---|
requests + threads |
8 threads in ThreadPoolExecutor | 2.35 | + 1305% |
aiohttp |
1 asynchronous thread | 0.18 | 0 % |
Tool | Description | Benchmark values, sec | Comparing, % |
---|---|---|---|
psycopg |
8 workers in ThreadPool | 2.25 | 0 |
asyncpg |
1 asynchronous thread | 18.93 | + 841% |