Cold Starts Benchmarks

Cold start metrics has been collected using the http server.

These metrics are also indicative of how well the serverless version performs in this regard, this is because both @mionkit/http an @mionkit/serverless are simple wrappers around @mionkit/router which contains all the logic.

  • These metrics show the start time when loading 1 route and then increasing the number or routes loaded until 5,000 routes.
  • The startup time is the time it takes create the routes + initialize the server.
  • The listen time is the time it takes to add all the routes to the server and for the server to be ready listening for requests.

We are comparing mion against fastify as we consider it to be the gold standard in node frameworks and against deepkit as we use some of their libraries and has similar functionalities (validation and serialization).


Benchmarks

  • Machine: darwin x64 | 8 vCPUs | 16.0GB Mem
  • Node: v18.17.0
  • Run: Tue Aug 15 2023 15:20:10 GMT+0100 (Irish Standard Time)
  • Method: npm run metrics (samples: 5)
  • startup: time elapsed to setup the application
  • listen: time elapsed until the http server is ready to accept requests (cold start)

Listen time (ms)

benchmarks

Time in (ms) lower is better

View in Benchmark's Repo

Results Table

startup(ms)listen(ms)
10-startup-deepkit-routes.js12401241
10-startup-fastify-routes.js149215
10-startup-mion-routes.js8088
100-startup-deepkit-routes.js12441245
100-startup-fastify-routes.js162319
100-startup-mion-routes.js7987
500-startup-deepkit-routes.js12361237
500-startup-fastify-routes.js237746
500-startup-mion-routes.js7889
1000-startup-deepkit-routes.js12411243
1000-startup-fastify-routes.js3371247
1000-startup-mion-routes.js7993
2000-startup-deepkit-routes.js12541255
2000-startup-fastify-routes.js5512319
2000-startup-mion-routes.js80103
3000-startup-deepkit-routes.js12741275
3000-startup-fastify-routes.js8433523
3000-startup-mion-routes.js80113
5000-startup-deepkit-routes.js12861287
5000-startup-fastify-routes.js18416456
5000-startup-mion-routes.js82124
startup-listen.js8287