granian/benchmarks
Giovanni Barillari e9518354bb
Bump version to 2.0 (#507)
* Add back custom allocators

* Rename runtime params

* Stop producing PGO builds
2025-02-25 20:27:28 +01:00
..
app Add Python version benchmarks (#421) 2024-10-28 01:54:51 +01:00
envs Update benchmarks 2025-01-30 18:10:25 +01:00
external Update external benchmark results (#504) 2025-02-06 12:34:38 +01:00
files Update benchmarks suite (#266) 2024-04-12 20:27:21 +02:00
results add benchmarks suite 2022-04-18 18:37:17 +02:00
templates Update benchmarks 2025-01-30 18:10:25 +01:00
ws Update benchmarks 2025-01-30 18:10:25 +01:00
benchmarks.py Bump version to 2.0 (#507) 2025-02-25 20:27:28 +01:00
concurrency.md Update benchmarks 2025-01-30 18:10:25 +01:00
pyver.md Update benchmarks 2025-01-30 18:10:25 +01:00
README.md Update benchmarks 2025-01-30 18:10:25 +01:00
vs.md Update benchmarks 2025-01-30 18:10:25 +01:00

Granian benchmarks

Run at: Thu 30 Jan 2025, 02:28
Environment: AMD Ryzen 7 5700X @ Ubuntu 24.04 (CPUs: 16)
Python version: 3.11
Granian version: 1.7.6

Note: unless otherwise specified, all benchmarks are run with 1 server worker and 1 thread.

RSGI response types

RSGI plain text response comparison using protocol response_str and response_bytes.
The "small" response is 4 bytes, the "big" one is 80kbytes.

Type Total requests RPS avg latency max latency
bytes small (c256) 909712 91109 2.807ms 15.337ms
str small (c256) 901597 90315 2.832ms 15.639ms
bytes big (c128) 494866 49503 2.583ms 14.92ms
str big (c128) 445717 44596 2.867ms 18.307ms

Interfaces

Comparison between Granian application protocols using 4bytes plain text response.
Bytes and string response are reported for every protocol just to report the difference with RSGI protocol.
ASGI and WSGI responses are always returned as bytes by the application.
The "echo" request is a 4bytes POST request responding with the same body.

Request Total requests RPS avg latency max latency
RSGI bytes (c256) 900062 90119 2.838ms 12.855ms
RSGI str (c256) 881674 88317 2.896ms 15.554ms
RSGI echo (c256) 627527 62848 4.068ms 19.695ms
ASGI bytes (c128) 748186 74841 1.709ms 13.994ms
ASGI str (c128) 750228 75069 1.703ms 14.18ms
ASGI echo (c64) 503022 50302 1.271ms 2.575ms
WSGI bytes (c256) 642563 64367 3.973ms 15.454ms
WSGI str (c64) 629022 62904 1.016ms 2.361ms
WSGI echo (c256) 581620 58241 4.391ms 13.409ms

HTTP/2

Comparison between Granian HTTP versions on RSGI using 4bytes plain text response.

Request Total requests RPS avg latency max latency
HTTP/1 [GET] (c256) 897954 89939 2.843ms 14.539ms
HTTP/1 [POST] (c128) 647934 64831 1.972ms 12.859ms
HTTP/2 [GET] (c256) 874234 87629 2.918ms 46.195ms
HTTP/2 [POST] (c128) 634648 63508 2.012ms 12.346ms

File responses

Comparison between Granian application protocols using 95bytes image.
WSGI is not part of the benchmark since the protocol doesn't implement anything different from returning the file's contents directly.

Request Total requests RPS avg latency max latency
RSGI (c256) 748074 74903 3.411ms 25.448ms
ASGI (c64) 328688 32870 1.945ms 2.515ms
ASGI pathsend (c512) 631845 63485 8.052ms 69.429ms

Other benchmarks

3rd party benchmarks