{"id":15138313,"url":"https://github.com/rousan/rust-web-frameworks-benchmark","last_synced_at":"2025-10-23T14:31:12.612Z","repository":{"id":44700589,"uuid":"244729723","full_name":"rousan/rust-web-frameworks-benchmark","owner":"rousan","description":"A hello world benchmark for the available Rust Web Frameworks: hyper vs gotham vs actix-web vs warp vs rocket","archived":false,"fork":false,"pushed_at":"2022-01-30T14:33:51.000Z","size":71,"stargazers_count":109,"open_issues_count":9,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-30T18:52:00.879Z","etag":null,"topics":["actix","actix-web","benchmark","gotham-rs","hyper","rocket","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rousan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-03T20:00:21.000Z","updated_at":"2024-12-07T10:56:38.000Z","dependencies_parsed_at":"2022-09-11T03:00:40.102Z","dependency_job_id":null,"html_url":"https://github.com/rousan/rust-web-frameworks-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Frust-web-frameworks-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Frust-web-frameworks-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Frust-web-frameworks-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rousan%2Frust-web-frameworks-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rousan","download_url":"https://codeload.github.com/rousan/rust-web-frameworks-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237843667,"owners_count":19375180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actix","actix-web","benchmark","gotham-rs","hyper","rocket","rust"],"created_at":"2024-09-26T07:21:42.221Z","updated_at":"2025-10-23T14:31:07.328Z","avatar_url":"https://github.com/rousan.png","language":"Rust","readme":"# Benchmarking Rust Web Frameworks: hyper vs gotham vs actix-web vs warp vs rocket\n\nI was building a very performance sensitive API service using Rust and I was trying to find out which http framework I should use\nas there a lot of frameworks out there for Rust. So, I just shortlisted some of them and I ran a `hello world route` for every frameworks\nand its result is very interesting.\n\n## Benchmarking Tool\n\nI used `wrk` to test those http servers:\n\n```sh\n$ wrk --latency -t4 -c200 -d8s http://127.0.0.1:8081\n```\n\n## Results\n\nI ran all those tests on:\n\n`Intel Core i7 CPU @ 3.20GHz × 12, 16GB of RAM`\n\nBefore run, I created a release build:\n\n```sh\n$ cargo build --release\n```\n\n### Framework 1: hyper (https://github.com/hyperium/hyper)\n\n_Requests/sec:_ `520718.02` and _Latency:_ `368.31us`\n\n```txt\nRunning 8s test @ http://127.0.0.1:8082\n  4 threads and 200 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency   368.31us  327.11us   8.11ms   92.48%\n    Req/Sec   131.79k     6.77k  147.18k    77.50%\n  Latency Distribution\n     50%  295.00us\n     75%  390.00us\n     90%  595.00us\n     99%    1.64ms\n  4196014 requests in 8.06s, 352.14MB read\nRequests/sec: 520718.02\nTransfer/sec:     43.70MB\n```\n\n### Framework 2: actix-web (https://github.com/actix/actix-web)\n\n_Requests/sec:_ `562315.64` and _Latency:_ `365.86us`\n\n```txt\nRunning 8s test @ http://127.0.0.1:8080\n  4 threads and 200 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency   365.86us  659.57us  18.39ms   94.46%\n    Req/Sec   142.44k     7.76k  150.25k    92.19%\n  Latency Distribution\n     50%  238.00us\n     75%  328.00us\n     90%  451.00us\n     99%    3.35ms\n  4534091 requests in 8.06s, 557.80MB read\nRequests/sec: 562315.64\nTransfer/sec:     69.18MB\n```\n\n### Framework 3: warp (https://github.com/seanmonstar/warp)\n\n_Requests/sec:_ `506776.84` and _Latency:_ `393.21us`\n\n```txt\nRunning 8s test @ http://127.0.0.1:3030\n  4 threads and 200 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency   393.21us  487.15us  21.55ms   95.16%\n    Req/Sec   128.68k     7.57k  146.42k    79.06%\n  Latency Distribution\n     50%  305.00us\n     75%  410.00us\n     90%  620.00us\n     99%    1.80ms\n  4098580 requests in 8.09s, 320.51MB read\n  Non-2xx or 3xx responses: 4098580\nRequests/sec: 506776.84\nTransfer/sec:     39.63MB\n```\n\n### Framework 4: gotham (https://github.com/gotham-rs/gotham)\n\n_Requests/sec:_ `300483.70` and _Latency:_ `677.14us`\n\n```txt\nRunning 8s test @ http://127.0.0.1:8081\n  4 threads and 200 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency   677.14us  513.16us  15.78ms   87.00%\n    Req/Sec    76.36k     6.20k   88.57k    74.38%\n  Latency Distribution\n     50%  554.00us\n     75%  816.00us\n     90%    1.19ms\n     99%    2.66ms\n  2431445 requests in 8.09s, 384.92MB read\nRequests/sec: 300483.70\nTransfer/sec:     47.57MB\n```\n\n### Framework 5: Rocket (https://github.com/SergioBenitez/Rocket)\n\n_Requests/sec:_ `115231.95` and _Latency:_ `412.75us`\n\n```txt\nRunning 8s test @ http://127.0.0.1:8000\n  4 threads and 200 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency   412.75us    1.35ms 204.10ms   99.83%\n    Req/Sec    29.20k     1.60k   31.79k    85.94%\n  Latency Distribution\n     50%  312.00us\n     75%  551.00us\n     90%  737.00us\n     99%    0.99ms\n  929792 requests in 8.07s, 129.46MB read\n  Socket errors: connect 0, read 929766, write 0, timeout 0\nRequests/sec: 115231.95\nTransfer/sec:     16.04MB\n```\n\n#### Caveat\n\nIn order to run a fair comparison a suitable environment variable should be set\nwhile running, `ROCKET_ENV=prod ./rocket`.\nIndeed, by default is set to `dev`, and it is spending a lot of time logging\neverything on the console.\n\n## Conclusion\n\n`hyper` -\u003e Perfect for an app which requires more controls on http and\nperformance. It provides `async` with `tokio.rs`.\n\n`gotham` -\u003e A high-level version of `hyper`.\n\n`actix-web` -\u003e Provides a very high-level API and injects some boilerplate code\nas well as runtime. It provides `async` with `tokio.rs`.\n\n`warp` -\u003e A very high level version of `hyper` and easy to use and it requires\na few lines of codes to start a server. It provides `async` with `tokio.rs`.\n\n`rocket` -\u003e High level, actively developed and quite used. Nevertheless it has\nnot the same performances as the others.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frousan%2Frust-web-frameworks-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frousan%2Frust-web-frameworks-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frousan%2Frust-web-frameworks-benchmark/lists"}