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 to index.html[!IMPORTANT] The default settings of
autocannonare 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.