Static servers are created using different frameworks :
native
: based on Node.js v20.11.11 http layer (src)reserve
: based on REserve 2️⃣ (src)express
: based on express (src)koa
: based on koa and koa-send (src)fastify
: based on fastify and @fastify/static (src)
A benchmark tool - based on autocannon - measure the number of hits achieved on the following URLs :
/hello
: which returns "Hello World !" statically/index.html
: which is a file mapping toindex.html
Important
The default settings of autocannon
are kept : 10 rounds of measurements are recorded.
implementation | Average hits / 10s |
---|---|
express | 81019 |
koa | 224420 |
reserve | 226501 |
fastify | 252594 |
native | 279925 |
implementation | Average hits / 10s |
---|---|
index.html | 45396 |
express | 43082 |
native | 43703 |
koa | 44386 |
reserve | 47163 |
fastify | 48750 |
Note
Some implementations cache the file information. It explains why they are faster than the native one.
REserve appears to be slower than fastify but is faster than express and koa.