Which is the fastest web framework?
Clone or download
1ma and waghanza Opcache (#445)
* php-opcache

* avoid extra access to disk on each request

* enable FastRoute cache
Latest commit fc9cddc Oct 20, 2018

README.md

Which is the fastest?

Build Status Join the chat at https://gitter.im/which_is_the_fastest/Lobby

This project aims to be a load benchmarking suite, no more, no less

Measuring response times (routing times) for each framework (middleware).

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
Results are not production-ready yet
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

Additional purposes :

  • Helping decide beetween languages, depending on use case
  • Learning languages, best practices, devops culture ...
  • Having fun ❤️

Requirements

  • Crystal as built-in tools are made in this language
  • Docker as frameworks are isolated into containers

⚠️ docker is used for development purpose, production results will be computed on DigitalOcean ⚠️

Usage

  • Install all dependencies
shards install
  • Build internal tools
shards build
  • Build containers

job is either a language (example : crystal) or a framework (example : router.cr)

bin/neph [job]
  • Start the benchmark ....

tools is a list of language / framework to challenge (example : ruby kemal amber go python)

bin/benchmarker [tools]

Results

Last update: 2018-10-20

OS: Linux (version: 4.18.14-200.fc28.x86_64, arch: x86_64)
CPU Cores: 8

Latency

Ranking (top 5)

1️⃣ nickel (rust)

2️⃣ rocket (rust)

3️⃣ slim (php)

4️⃣ iron (rust)

5️⃣ laravel (php)

Full table

Language (Runtime) Framework (Middleware) Average 50th percentile 90th percentile 99th percentile 99.9th percentile Standard deviation
rust (1.29) nickel (0.10) 0.08 ms 0.08 ms 0.12 ms 0.14 ms 3.39 ms 36.33
rust (nightly) rocket (0.3) 0.09 ms 0.09 ms 0.13 ms 0.18 ms 2.21 ms 36.33
php (7.2) slim (3.11) 97.78 ms 0.32 ms 277.49 ms 1440.46 ms 6853.93 ms 331444.00
rust (1.29) iron (0.6) 0.38 ms 0.38 ms 0.62 ms 0.88 ms 27.59 ms 309.67
php (7.2) laravel (5.7) 178.90 ms 0.42 ms 451.12 ms 2612.90 ms 6846.70 ms 536103.00
php (7.2) symfony (4.1) 115.77 ms 0.54 ms 333.92 ms 1488.99 ms 6839.64 ms 352324.67
ruby (2.5) rack-routing (0.0) 4.71 ms 0.74 ms 13.88 ms 44.46 ms 141.93 ms 9057.00
ruby (2.5) roda (3.13) 3.65 ms 1.09 ms 10.09 ms 31.95 ms 106.96 ms 6454.33
ruby (2.5) hanami (1.2) 8.07 ms 1.15 ms 24.76 ms 72.63 ms 207.72 ms 15010.33
rust (1.29) actix-web (0.7) 3.29 ms 2.28 ms 7.13 ms 16.10 ms 34.50 ms 3327.33
ruby (2.5) sinatra (2.0) 9.34 ms 2.59 ms 27.56 ms 72.79 ms 193.38 ms 15317.67
python (3.6) japronto (1.1) 3.53 ms 2.71 ms 7.40 ms 15.01 ms 34.74 ms 3290.67
ruby (2.5) flame (4.18) 7.65 ms 2.92 ms 21.46 ms 53.97 ms 147.53 ms 11468.00
go (1.11) fasthttprouter (0.1) 3.82 ms 3.23 ms 6.03 ms 12.41 ms 108.42 ms 3212.00
cpp (11.0) evhtp (1.2) 3.36 ms 3.38 ms 5.44 ms 7.96 ms 59.75 ms 1890.67
python (3.6) vibora (0.0) 4.71 ms 3.76 ms 9.48 ms 17.24 ms 58.30 ms 3825.33
nim (0.19) jester (0.4) 4.61 ms 3.93 ms 7.53 ms 14.02 ms 33.43 ms 2783.00
crystal (0.26.1) spider-gazelle (1.1) 4.58 ms 4.12 ms 8.38 ms 15.13 ms 31.79 ms 3022.67
c (??) kore (3.1) 4.77 ms 4.69 ms 7.88 ms 10.34 ms 20.56 ms 2408.00
go (1.11) muxie (1.0) 6.45 ms 5.40 ms 10.55 ms 21.11 ms 163.56 ms 5044.67
go (1.11) iris (10.7) 6.48 ms 5.44 ms 10.57 ms 21.11 ms 101.26 ms 3774.33
java (8) act (1.8) 6.48 ms 5.56 ms 10.98 ms 20.82 ms 100.55 ms 4318.67
csharp (7.3) aspnetcore (2.1) 6.51 ms 5.66 ms 9.46 ms 17.34 ms 283.48 ms 6714.33
go (1.11) echo (3.3) 7.45 ms 5.91 ms 12.32 ms 25.40 ms 192.85 ms 6959.67
go (1.11) gin (1.3) 7.35 ms 5.98 ms 12.32 ms 24.33 ms 119.29 ms 5063.33
go (1.11) beego (1.10) 7.36 ms 6.04 ms 12.11 ms 23.94 ms 165.84 ms 5376.33
go (1.11) gorilla-mux (1.6) 7.55 ms 6.29 ms 12.60 ms 24.12 ms 113.38 ms 4609.00
nim (0.19) mofuw (2.0) 38.55 ms 6.71 ms 153.54 ms 384.39 ms 607.75 ms 87161.67
scala (2.12) akkahttp (10.1) 133.07 ms 7.84 ms 28.93 ms 3114.37 ms 5850.29 ms 543476.00
node (10.12) polka (0.5) 11.35 ms 8.38 ms 17.52 ms 49.90 ms 528.74 ms 21080.33
node (10.12) rayo (1.2) 13.46 ms 8.90 ms 20.56 ms 93.99 ms 653.89 ms 29394.67
python (3.7) bottle (0.12) 11.26 ms 10.01 ms 17.91 ms 33.27 ms 287.15 ms 8817.67
ruby (2.5) rails (5.2) 40.22 ms 10.57 ms 128.30 ms 328.75 ms 874.87 ms 70350.33
swift (4.2) vapor (3.0) 16.37 ms 11.23 ms 19.75 ms 124.78 ms 904.04 ms 40634.33
node (10.12) fastify (1.12) 17.51 ms 11.69 ms 27.66 ms 98.96 ms 724.66 ms 32544.67
swift (4.2) perfect (3.0) 12.16 ms 12.26 ms 13.84 ms 15.82 ms 30.81 ms 1552.67
scala (2.12) http4s (0.18) 17.17 ms 14.01 ms 28.64 ms 51.18 ms 873.17 ms 33141.00
node (10.12) restify (7.2) 18.34 ms 14.60 ms 28.14 ms 64.83 ms 527.87 ms 21223.67
node (10.12) koa (2.5) 24.12 ms 16.34 ms 35.08 ms 189.66 ms 985.80 ms 49034.00
node (10.12) express (4.16) 26.23 ms 18.31 ms 38.31 ms 204.41 ms 959.77 ms 47950.67
python (3.6) aiohttp (3.4) 23.71 ms 19.76 ms 43.47 ms 69.62 ms 158.07 ms 14466.33
swift (4.2) kitura (2.5) 24.11 ms 21.50 ms 36.64 ms 51.26 ms 236.47 ms 9382.33
crystal (0.26.1) router.cr (0.2) 25.87 ms 24.19 ms 33.67 ms 43.63 ms 390.35 ms 12962.33
crystal (0.25.1) lucky (0.11) 27.56 ms 24.35 ms 36.34 ms 44.80 ms 306.65 ms 9665.67
crystal (0.26.1) kemal (0.24) 27.98 ms 24.58 ms 39.60 ms 51.08 ms 398.50 ms 13141.00
crystal (0.25.1) raze (0.3) 25.75 ms 25.06 ms 33.02 ms 42.12 ms 386.43 ms 12686.33
node (10.12) hapi (17.6) 46.32 ms 25.51 ms 50.02 ms 719.32 ms 1711.78 ms 119355.00
crystal (0.26.1) orion (1.6) 31.00 ms 26.18 ms 45.03 ms 59.06 ms 479.76 ms 15485.00
python (3.7) flask (1.0) 34.40 ms 26.59 ms 64.91 ms 109.55 ms 306.95 ms 21231.33
crystal (0.26.1) amber (0.9) 33.32 ms 32.81 ms 40.25 ms 50.77 ms 476.50 ms 17542.67
python (3.7) sanic (0.8) 50.90 ms 42.76 ms 97.01 ms 189.36 ms 373.94 ms 37463.00
python (3.7) django (2.1) 61.41 ms 46.86 ms 120.65 ms 179.40 ms 536.73 ms 39455.00
python (3.7) quart (0.6) 96.90 ms 84.83 ms 188.22 ms 301.92 ms 446.59 ms 66175.33
python (3.7) tornado (5.1) 88.90 ms 85.58 ms 126.21 ms 172.96 ms 489.76 ms 29567.33

Requests per seconds

Ranking (top 5)

1️⃣ (actix-web) (rust)

2️⃣ (japronto) (python)

3️⃣ (evhtp) (cpp)

4️⃣ (fasthttprouter) (go)

5️⃣ (jester) (nim)

Full table

Language (Runtime) Framework (Middleware) Requests / s Throughput
rust (1.29) actix-web (0.7) 317261.33 360.68 MB
python (3.6) japronto (1.1) 288160.67 344.98 MB
cpp (11.0) evhtp (1.2) 263083.33 255.35 MB
go (1.11) fasthttprouter (0.1) 245917.00 396.20 MB
nim (0.19) jester (0.4) 230753.67 464.01 MB
python (3.6) vibora (0.0) 225406.00 255.87 MB
crystal (0.26.1) spider-gazelle (1.1) 214744.00 229.33 MB
java (8) act (1.8) 209487.33 358.37 MB
rust (1.29) iron (0.6) 158920.33 200.86 MB
go (1.11) muxie (1.0) 150553.67 202.07 MB
go (1.11) iris (10.7) 150410.67 200.99 MB
csharp (7.3) aspnetcore (2.1) 147429.33 240.41 MB
rust (nightly) rocket (0.3) 143891.33 229.72 MB
go (1.11) echo (3.3) 135715.67 238.13 MB
go (1.11) gin (1.3) 134727.00 236.48 MB
go (1.11) beego (1.10) 133495.33 180.14 MB
go (1.11) gorilla-mux (1.6) 130279.67 173.85 MB
nim (0.19) mofuw (2.0) 120837.00 212.00 MB
node (10.12) polka (0.5) 103871.33 155.67 MB
rust (1.29) nickel (0.10) 100511.67 200.41 MB
node (10.12) rayo (1.2) 95373.33 142.96 MB
python (3.7) bottle (0.12) 89986.67 221.68 MB
swift (4.2) perfect (3.0) 83097.67 78.11 MB
swift (4.2) vapor (3.0) 75149.00 126.60 MB
node (10.12) fastify (1.12) 73275.67 176.24 MB
scala (2.12) akkahttp (10.1) 69871.67 150.03 MB
scala (2.12) http4s (0.18) 65823.67 115.12 MB
c (??) kore (3.1) 61764.00 167.36 MB
node (10.12) restify (7.2) 60512.00 106.13 MB
node (10.12) koa (2.5) 53334.33 112.61 MB
php (7.2) symfony (4.1) 50176.67 249.36 MB
php (7.2) slim (3.11) 49731.33 246.78 MB
php (7.2) laravel (5.7) 47653.67 237.00 MB
node (10.12) express (4.16) 47281.33 115.54 MB
python (3.6) aiohttp (3.4) 43763.33 99.32 MB
swift (4.2) kitura (2.5) 40918.33 75.89 MB
crystal (0.25.1) raze (0.3) 38610.67 36.20 MB
crystal (0.26.1) router.cr (0.2) 38441.67 36.04 MB
crystal (0.25.1) lucky (0.11) 35933.33 44.21 MB
crystal (0.26.1) kemal (0.24) 35666.33 58.08 MB
node (10.12) hapi (17.6) 35590.00 91.90 MB
ruby (2.5) roda (3.13) 35404.33 33.72 MB
crystal (0.26.1) orion (1.6) 32154.67 52.38 MB
crystal (0.26.1) amber (0.9) 30742.33 44.57 MB
python (3.7) flask (1.0) 30140.33 74.30 MB
ruby (2.5) rack-routing (0.0) 27591.00 15.91 MB
python (3.7) sanic (0.8) 21198.00 37.75 MB
python (3.7) django (2.1) 17135.67 49.73 MB
ruby (2.5) flame (4.18) 16879.33 9.72 MB
ruby (2.5) hanami (1.2) 16036.00 121.34 MB
ruby (2.5) sinatra (2.0) 13682.00 35.53 MB
python (3.7) quart (0.6) 10896.67 21.70 MB
python (3.7) tornado (5.1) 10884.67 29.08 MB
ruby (2.5) rails (5.2) 3193.67 9.74 MB

How to contribute ?

In any way you want ...

  • Request a framework addition
  • Report a bug (on any implementation)
  • Suggest an idea
  • ...

Any kind of idea is ❤️

Contributors