/web-frameworks

Which is the fastest web framework?

Primary LanguagePHPMIT LicenseMIT

Which is the fastest ?


Simple framework comparison



Build Status Chat with us License

Motivation

There are many frameworks, each one comes with its own advantages and drawbacks. The purpose of this project is to identify them and attempt to measure their differences (performance is only one metric).

What is a framework ?

A framework is a set of components working together. The main intention behind a framework is to facilitate (app or service) creation. The way a framework help any developer could vary from one to an other.

A majority of frameworks could be splitted in 2 parts :

  • full-stack meaning it provides all aspects (-stacks-) from data layer to sometimes deployment
  • micro meaning it provides only the routing part, and let the developer choose any other component for the others

Requirements

  • ruby, all tools are made in ruby
  • wrk, results are collected using wrk
  • postgresql, results are stored in postgresql
  • docker, each implementation is implemented in an isolated container
  • jq, processing docker metadata
  • docker-machine if you are on macos

Usage

  • Setup
bundle install
bundle exec rake config
  • Build

⚠️ On macos, you need to use docker-machine to allow docker usage for each framework ⚠️

docker-machine rm default --force
docker-machine create default
eval $(docker-machine env default)
export FRAMEWORK=php/lumen
cd ${FRAMEWORK} 
make -f .Makefile build 
  • Run
make -f ${FRAMEWORK}/.Makefile collect

⚠️ You need to be on the project main directory ⚠️

Results (2021-04-15)

Technical details
  • CPU : 8 Cores (AMD FX-8320E Eight-Core Processor)
  • RAM : 16 Gb
  • OS : Fedora
  • Docker version 20.10.5, build 55c4c88
    
Datatable Computed with https://github.com/wg/wrk + Threads : 8 + Timeout : 8 + Duration : 15s (seconds)

ℹ️ Sorted by max req/s on concurrency 64 ℹ️

Language Framework Speed (64) Speed (256) Speed (512)
1 php (7.4) mark (1.1) 180 399.05 199 648.58 203 299.50
2 go (1.16) fiber (2.7) 180 036.08 193 413.58 192 348.44
3 go (1.16) gearbox (1.2) 177 012.27 183 413.15 183 688.88
4 go (1.16) atreugo (11.6) 176 498.90 188 350.50 188 315.50
5 go (1.16) gorouter-fasthttp (4.4) 176 141.56 186 666.08 186 300.55
6 go (1.16) router (1.3) 175 784.57 188 258.04 187 793.39
7 go (1.16) fasthttp (1.23) 174 979.93 193 891.65 194 423.04
8 java (11) activej (4.1) 165 677.52 196 657.47 200 255.01
9 nim (1.4) httpbeast (0.2) 163 378.30 195 861.92 199 874.33
10 rust (1.51) actix (3.3) 160 985.58 184 838.80 186 306.91
11 php (7.4) webman (1.0) 155 853.13 168 014.23 170 595.41
12 kotlin (1.4) kooby (2.9) 153 899.25 191 620.53 197 626.83
13 crystal (0.36) router.cr (0.2) 151 924.25 172 990.61 173 533.01
14 nim (1.4) whip (0.2) 150 939.47 179 336.79 183 348.21
15 java (11) vertx (4.0) 149 561.08 174 263.47 175 494.63
16 php (7.4) workerman (4.0) 148 900.21 177 720.81 182 130.39
17 java (11) undertow (2.2) 146 381.94 174 936.27 178 796.51
18 crystal (0.36) toro (0.4) 143 622.11 173 050.87 175 035.12
19 crystal (0.36) spider-gazelle (4.2) 141 710.78 168 756.74 169 974.77
20 crystal (0.36) runcobo (1.0) 140 915.88 165 338.70 165 595.37
21 java (11) rapidoid (5.5) 137 295.04 166 592.33 170 066.82
22 java (11) jooby (2.9) 135 373.46 174 950.11 183 720.93
23 crystal (0.36) kemal (0.27) 135 193.29 160 799.25 160 611.60
24 java (11) vertx4web (4.0) 134 298.44 156 100.61 158 143.09
25 crystal (0.36) grip (1.0) 132 603.67 154 430.23 152 195.67
26 java (11) light-4j (2.0) 131 103.77 169 200.80 173 996.21
27 crystal (0.36) amber (0.36) 131 054.68 150 918.80 149 302.02
28 javascript (14.16) sifrr (0.0) 130 925.12 168 525.55 174 072.23
29 java (11) quarkus (1.13) 126 604.59 155 402.66 159 515.76
30 javascript (14.16) nanoexpress (2.4) 125 557.05 164 974.15 170 903.31
31 nim (1.4) jester (0.5) 120 740.33 143 667.00 147 234.79
32 php (7.4) simps (1.0) 119 943.76 148 754.20 163 546.55
33 go (1.16) rte (0.0) 119 847.25 120 841.32 124 162.35
34 go (1.16) clevergo (0.5) 119 090.48 120 149.46 123 373.65
35 go (1.16) httprouter (1.3) 118 150.14 118 409.32 121 692.00
36 go (1.16) echo (4.2) 118 092.56 118 743.89 122 105.26
37 go (1.16) gin (1.7) 115 333.15 121 013.19 123 748.48
38 clojure (1.1) donkey (0.5) 113 901.73 124 084.83 124 996.27
39 go (1.16) aero (1.3) 113 896.13 113 879.15 117 030.97
40 go (1.16) chi (1.5) 112 880.57 111 294.14 115 392.51
41 go (1.16) gorouter (4.5) 111 474.31 118 486.08 120 619.33
42 go (1.16) violetear (7.0) 111 199.97 109 504.02 113 377.76
43 go (1.16) webgo (5.0) 109 786.10 107 919.12 111 617.55
44 go (1.16) goroute (0.0) 109 366.09 106 797.78 111 118.42
45 go (1.16) kami (2.2) 109 239.29 114 032.34 114 909.78
46 crystal (0.36) athena (0.13) 107 607.50 117 222.41 110 998.35
47 c (11) agoo-c (0.7) 107 320.04 182 170.28 186 124.95
48 rust (1.51) salvo (0.10) 106 509.89 133 221.19 142 053.58
49 scala (2.13) finatra (21.3) 105 893.77 124 352.22 124 573.22
50 go (1.16) gorilla-mux (1.8) 105 645.17 101 622.05 106 590.36
51 csharp (8.0) aspnetcore (5.0) 104 991.67 121 724.15 126 649.98
52 fsharp (5.0) frank (6.2) 104 224.07 123 005.09 127 618.20
53 rust (1.51) iron (0.6) 103 245.31 103 395.08 103 488.15
54 rust (1.51) gotham (0.6) 101 914.79 126 560.87 134 795.52
55 go (1.16) beego (1.12) 101 451.32 105 465.17 108 875.59
56 php (7.4) swoole (4.6) 97 346.54 122 423.53 137 500.60
57 fsharp (5.0) falco (3.0) 96 114.84 112 209.05 116 429.72
58 go (1.16) goyave (3.7) 95 473.97 96 541.51 100 336.16
59 java (11) act (1.9) 93 836.20 126 108.05 129 020.76
60 php (7.4) nano (0.0.9) 93 420.70 138 089.03 149 234.75
61 go (1.16) air (0.21) 93 383.99 92 234.32 95 970.96
62 javascript (14.16) naturaljs-router (0.1.1) 91 889.66 111 894.56 115 131.76
63 csharp (8.0) carter (5.2) 88 835.02 99 277.88 100 100.73
64 java (11) restheart (5.3) 88 640.30 95 004.33 94 407.63
65 php (7.4) swoole-coroutine (4.6) 87 054.38 125 878.86 136 587.08
66 rust (1.51) nickel (0.11) 85 191.99 87 979.53 91 733.37
67 scala (2.13) finch (0.32) 84 680.05 97 607.52 97 587.70
68 javascript (14.16) low-http-server (2.1) 80 555.94 95 246.43 97 513.85
69 go (1.16) gf (1.15) 80 066.51 87 995.06 90 575.75
70 fsharp (5.0) saturn (0.14) 79 027.95 86 173.01 85 380.74
71 swift (5.3) hummingbird (0.9) 76 453.42 82 532.43 82 826.51
72 scala (2.13) akkahttp (10.2) 76 361.38 90 519.39 87 828.60
73 elixir (1.12) cowboy_stream (2.8) 75 513.33 78 806.85 77 142.17
74 php (7.4) one (2.2) 73 695.75 86 334.02 96 700.48
75 swift (5.3) perfect (3.1) 73 119.27 82 413.04 91 600.14
76 kotlin (1.4) http4k (3.275) 72 636.57 85 800.67 88 877.28
77 php (7.4) hyperf (2.1) 72 275.12 88 738.27 96 934.50
78 python (3.9) falcon (3.0) 71 490.22 78 381.04 79 377.53
79 haskell (8.8) scotty (0.12) 68 287.71 85 287.64 89 606.50
80 kotlin (1.4) ktor (1.5) 67 959.08 89 479.83 91 703.89
81 fsharp (5.0) websharper (4.7) 67 801.97 77 428.32 77 646.72
82 c (11) kore (3.3) 67 554.78 134 908.55 136 439.33
83 java (11) spark (2.9) 67 349.69 75 615.51 77 219.85
84 javascript (14.16) polkadot (1.0) 67 258.01 81 678.75 82 687.32
85 cpp (11) drogon (1.5) 66 580.12 66 511.45 60 729.82
86 go (1.16) mars (1.0) 65 512.71 66 347.12 71 421.58
87 javascript (14.16) 0http (3.1) 65 493.68 78 929.87 79 811.57
88 javascript (14.16) rayo (1.3) 64 260.44 72 702.18 72 081.32
89 java (11) javalin (3.9) 63 777.60 69 794.84 71 122.61
90 javascript (14.16) polka (0.5) 63 184.56 71 960.48 70 965.34
91 java (11) spring (2.4) 60 814.86 72 985.02 72 417.72
92 ruby (3.0) agoo (2.14) 60 285.33 88 819.57 100 319.27
93 python (3.9) bottle (0.12) 60 154.29 65 185.28 65 516.47
94 javascript (14.16) restana (4.7) 58 054.53 70 274.88 70 307.67
95 javascript (14.16) muneem (2.4) 56 882.00 64 025.68 63 193.92
96 javascript (14.16) foxify (0.1) 53 206.87 59 264.32 58 973.89
97 clojure (1.1) coast (1.0) 52 784.29 53 927.21 53 733.39
98 swift (5.3) vapor (4.44) 49 945.17 52 270.39 52 133.94
99 php (7.4) chubbyphp-workerman (3.4) 49 550.41 53 141.74 53 783.54
100 python (3.9) apidaora (0.28) 49 159.57 55 680.73 56 136.82
101 swift (5.3) kitura-nio (2.9) 48 727.99 48 343.75 47 945.49
102 elixir (1.12) cowboy (2.8) 48 650.00 50 255.29 51 036.83
103 swift (5.3) kitura (2.9) 48 371.07 48 506.81 48 790.80
104 javascript (14.16) nestjs-fastify (7.6) 48 138.19 53 940.75 53 161.21
105 javascript (14.16) koa (2.13) 47 554.58 52 912.88 52 093.77
106 python (3.9) hug (2.6) 46 289.02 50 985.08 50 850.40
107 php (7.4) siler-swoole (1.7) 45 909.59 57 089.97 63 600.30
108 cpp (11) evhtp (1.2) 45 723.55 45 931.37 45 172.57
109 python (3.9) pyramid (2.0) 45 626.22 48 023.27 48 128.96
110 python (3.9) asgineer (0.8) 43 694.85 50 258.08 50 990.20
111 javascript (14.16) iotjs-express (0.0) 43 664.95 48 321.87 47 230.57
112 scala (2.13) http4s (0.21) 43 381.12 50 563.16 50 687.22
113 php (7.4) imi (1.2) 42 407.17 49 312.82 50 473.50
114 python (3.9) blacksheep (1.0) 41 825.71 48 770.52 47 747.27
115 csharp (8.0) simplify.web (4.2) 41 436.43 44 981.70 44 461.19
116 java (11) micronaut (1.2) 40 872.96 49 977.84 50 641.10
117 php (7.4) yii-swoole (2.0) 40 475.59 44 689.36 47 691.38
118 python (3.9) sanic (21.3) 40 458.75 41 790.44 43 648.50
119 fsharp (5.0) suave (2.6) 39 860.39 33 122.26 26 998.77
120 javascript (14.16) fastify (3.14) 38 899.73 43 813.96 42 811.66
121 javascript (14.16) fyrejet (3.1) 38 181.64 41 204.63 40 512.73
122 python (3.9) starlette (0.14) 37 884.50 41 161.98 42 186.55
123 elixir (1.12) plug (1.11) 36 795.84 40 040.48 39 103.71
124 php (7.4) comet (1.2) 36 210.20 37 140.07 36 835.13
125 scala (2.13) play (2.8) 35 915.92 39 389.06 38 892.59
126 javascript (14.16) moleculer (0.14) 35 805.74 38 994.40 38 199.33
127 crystal (0.36) orion (3.0) 34 954.74 35 362.67 31 837.74
128 clojure (1.1) luminus (4.0) 34 890.97 37 066.30 36 973.62
129 dart (2.12) aqueduct (3.3) 34 631.08 34 577.60 34 248.84
130 javascript (14.16) fyrejet-uwebsockets (3.1) 33 710.12 35 616.21 35 582.18
131 r (4.0) rserve (1.7) 32 923.37 24 123.66 25 732.92
132 python (3.9) index.py (0.17) 32 892.74 31 839.42 30 637.71
133 python (3.9) emmett (2.2) 32 632.01 39 464.96 37 371.58
134 elixir (1.12) phoenix (1.5) 32 184.54 34 945.19 34 907.13
135 haskell (8.8) servant (0.18) 32 031.60 29 984.80 28 618.47
136 javascript (14.16) restify (8.5) 31 487.68 34 384.67 34 088.69
137 fsharp (5.0) giraffe (4.1) 29 657.39 29 563.18 29 059.56
138 crystal (0.36) shivneri (0.17) 29 501.80 28 178.90 22 664.88
139 javascript (14.16) hapi (20.1) 29 136.34 30 879.14 30 445.88
140 python (3.9) aiohttp (3.7) 27 955.51 31 876.56 31 166.15
141 php (7.4) swoft (2.0) 26 799.78 34 191.19 33 980.37
142 nim (1.4) mike (0.5) 26 679.87 26 234.61 26 189.93
143 python (3.9) responder (2.0) 25 838.67 27 953.04 27 630.20
144 python (3.9) molten (1.0) 24 630.83 28 142.90 25 257.15
145 php (7.4) sw-fw-less (preview) 24 409.39 30 119.79 30 177.42
146 python (3.9) clastic (19.9) 23 871.08 26 860.83 26 081.04
147 python (3.9) fastapi (0.63) 23 628.68 23 781.04 22 947.37
148 php (7.4) chubbyphp-swoole (3.4) 23 312.86 28 523.31 29 183.76
149 javascript (14.16) turbo_polka (0.3) 23 276.36 21 966.69 20 861.01
150 go (1.16) macaron (1.4) 23 240.76 25 351.44 25 490.95
151 java (11) jersey3-grizzly2 (3) 23 033.75 32 045.91 31 882.71
152 java (11) jersey-grizzly2 (2.33) 22 893.81 30 753.54 30 641.14
153 python (3.9) flask (1.1) 22 602.40 25 350.25 24 415.15
154 ruby (3.0) roda (3.43) 22 190.69 21 640.45 21 341.36
155 php (7.4) slim-swoole (4.7) 21 691.18 25 602.80 25 385.42
156 ruby (3.0) syro (3.2) 21 549.33 20 730.14 20 911.76
157 nim (1.4) rosencrantz (0.4) 21 480.32 18 782.16 17 456.16
158 ruby (3.0) hanami-api (0.1) 21 364.36 20 501.10 20 534.54
159 javascript (14.16) feathersjs (4.5) 19 622.62 19 618.15 19 412.10
160 nim (1.4) akane (0.1) 19 278.22 17 247.14 16 095.88
161 javascript (14.16) express (4.17) 19 117.54 19 059.48 18 661.69
162 ruby (3.0) cuba (3.9) 18 386.03 17 857.93 17 614.03
163 php (7.4) antidot (0.2) 18 320.25 22 572.59 16 445.41
164 ruby (3.0) rack-routing (0.0) 17 842.02 17 110.92 17 119.84
165 ruby (3.0) rack_app (7.7) 17 191.10 16 416.73 16 199.73
166 java (11) blade (2.0) 16 962.47 20 651.30 19 649.32
167 go (1.16) tango (0.6) 16 852.13 17 312.77 17 379.91
168 ruby (3.0) camping (2.1) 16 438.46 15 860.33 15 996.47
169 dart (2.12) start (0.4) 15 282.89 14 828.78 14 483.51
170 go (1.16) gramework (1.7) 14 882.50 15 202.26 15 211.77
171 php (7.4) chubbyphp-roadrunner (3.4) 14 557.51 14 790.36 14 926.78
172 php (7.4) spiral (2.7) 14 277.61 14 454.27 14 525.63
173 php (7.4) sunrise-router-roadrunner (2.6) 14 131.07 14 392.21 14 534.58
174 php (7.4) slim-roadrunner (4.7) 14 123.95 14 313.72 14 469.88
175 javascript (14.16) nestjs-express (7.6) 13 925.40 14 202.78 14 107.22
176 python (3.9) guillotina (6.2) 13 516.50 12 740.37 12 105.62
177 php (7.4) laravel-s-lumen (3.7) 13 322.45 13 891.16 14 017.70
178 swift (5.3) swifter (1.5) 12 644.18 12 858.24 13 325.30
179 python (3.9) quart (0.14) 11 506.62 10 670.01 10 208.36
180 java (11) struts2 (2.5) 11 358.53 12 035.00 12 106.00
181 pony (0.39) jennet (0.1) 11 142.97 19 495.27 18 036.62
182 ruby (3.0) sinatra (2.1) 10 983.09 10 693.42 10 701.72
183 python (3.9) tonberry (0.2) 10 950.85 10 252.90 9 501.98
184 php (7.4) basicphp (0.9) 10 174.45 11 047.09 10 878.99
185 python (3.9) cherrypy (18.6) 9 973.78 9 433.71 9 410.09
186 ruby (3.0) grape (1.5) 9 931.73 9 672.95 9 648.92
187 php (7.4) fastsitephp (1.4) 9 918.71 10 619.70 10 515.59
188 php (7.4) laravel-s-laravel (3.7) 9 697.70 9 589.25 9 551.41
189 python (3.9) tornado (6.1) 8 580.85 8 668.14 8 314.25
190 python (3.9) django (3.2) 8 469.82 8 148.59 7 982.05
191 php (7.4) ubiquity (2.3) 8 349.40 8 781.92 8 746.85
192 php (7.4) one-fpm (2.2) 7 393.77 7 741.25 7 683.20
193 php (7.4) fatfree (3.7) 7 125.11 7 563.78 7 559.21
194 clojure (1.1) yada (1.2) 7 095.84 8 385.57 8 637.71
195 php (7.4) phalcon (4.1) 7 093.08 7 502.74 7 402.44
196 php (7.4) hamlet (3.2) 6 794.38 7 185.11 7 157.68
197 php (7.4) siler (1.7) 6 620.95 7 002.21 6 938.23
198 php (7.4) bearframework (1.3) 5 923.02 6 300.41 6 294.76
199 php (7.4) ice (1.5) 5 816.35 6 138.73 6 079.25
200 php (7.4) sunrise-router (2.6) 5 529.42 5 749.38 5 777.06
201 php (7.4) chubbyphp (3.4) 5 055.81 5 241.32 5 226.36
202 javascript (14.16) sails (1.4) 5 025.51 5 127.94 5 093.85
203 php (7.4) cubex (4.16) 4 526.06 4 604.52 4 627.63
204 php (7.4) sunrise-router-annotations (2.6) 4 349.73 4 454.07 4 472.87
205 php (7.4) slim (4.7) 4 299.62 4 429.45 4 483.43
206 php (7.4) lumen (8.2) 3 877.83 3 926.90 3 957.93
207 php (7.4) nette (3.1) 3 848.96 3 968.97 3 953.07
208 php (7.4) yii (2.0) 3 735.00 3 819.60 3 835.23
209 php (7.4) driftphp (0.1) 3 718.53 4 617.75 4 925.58
210 python (3.9) masonite (3.0) 3 514.67 3 444.85 3 434.66
211 ruby (3.0) rails (6.1) 3 511.98 3 490.66 3 487.98
212 php (7.4) symfony (5.2) 3 025.39 3 035.91 3 044.85
213 julia (1.6) merly (1.0) 3 008.97 8 245.98 4 368.51
214 php (7.4) mezzio (3.3) 2 742.17 2 793.25 2 790.51
215 python (3.9) cyclone (1.3) 2 338.34 2 315.88 2 297.83
216 perl (5.32) dancer2 (0.3) 2 001.81 1 993.11 853.75
217 python (3.9) django-ninja (0.12) 1 961.98 2 599.55 2 511.67
218 r (4.0) restrserve (0.4) 1 820.13 1 775.33 1 784.65
219 r (4.0) httpuv (1.5) 1 810.73 1 741.67 1 684.50
220 php (7.4) laminas (3.2) 1 741.32 1 763.24 1 765.97
221 python (3.9) nameko (2.13) 1 693.27 1 633.58 1 615.32
222 php (7.4) laravel (8.37) 1 494.34 1 503.23 1 504.42
223 python (3.9) klein (20.6) 1 478.95 1 511.37 1 496.63
224 php (7.4) codeigniter4 (4.1) 1 206.07 1 228.74 1 227.87
225 php (7.4) unic (1.0) 466.73 495.17 425.34
226 r (4.0) plumber (1.1) 421.16 446.93 435.65
227 cpp (11) nawa (0.6) 362.61 NaN NaN