- graphql-jit helps
- apollo-server adds overhead
- tracing resolvers kills performance
- type-graphql adds overhead
For further details, please check out this video.
git clone https://github.com/benawad/benchmarks
cd benchmarks
npm install
npm start
duration: 5.02s connections: 5 pipelining: 1
Lenovo Workstation D20 @ 2*Xeon 5675 3.46 GHz 24 threads, 44GB RAM
┌──────────────────────────────────────────┬────────────┬─────────┬───────────────┐
│ Server │ Requests/s │ Latency │ Throughput/Mb │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ fastify-gql+graphql-jit │ 2878.6 │ 1.30 │ 17.93 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ uWebSockets-graphql+jit │ 2709.4 │ 1.33 │ 16.65 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ fastify-REST │ 2683.8 │ 1.34 │ 21.45 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ express-REST │ 2316.2 │ 1.55 │ 18.67 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ express-gql │ 1976.8 │ 1.77 │ 12.44 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ graphql-api-koa+graphql-jit │ 1579.2 │ 2.65 │ 9.84 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ express-graphql+graphql-jit │ 1381.0 │ 2.97 │ 8.69 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ fastify-gql │ 1368.6 │ 2.96 │ 8.53 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ express-graphql+graphql-jit+type-graphql │ 1186.0 │ 3.93 │ 7.46 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ apollo-server-fastify+graphql-jit │ 1076.4 │ 4.18 │ 6.72 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ graphql-api-koa │ 983.4 │ 4.40 │ 6.13 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ yoga-graphql │ 904.2 │ 5.16 │ 5.67 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ express-graphql │ 894.4 │ 5.27 │ 5.63 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ apollo-schema+async │ 885.0 │ 5.27 │ 5.57 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ type-graphql+async │ 823.2 │ 5.52 │ 5.18 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ express-graphql+type-graphql │ 822.6 │ 5.56 │ 5.18 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ type-graphql+middleware │ 806.4 │ 5.65 │ 5.08 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ type-graphql+async-middleware │ 802.8 │ 5.64 │ 5.05 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ apollo-server-fastify │ 751.2 │ 6.04 │ 4.69 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ apollo-server-express │ 674.6 │ 6.99 │ 4.27 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ express-graphql-dd-trace-no-plugin │ 650.0 │ 7.24 │ 4.09 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ gapi │ 560.8 │ 8.44 │ 3.52 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ apollo-opentracing │ 449.2 │ 10.58 │ 2.84 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ yoga-graphql-trace │ 377.8 │ 12.72 │ 12.11 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ apollo-server-express-tracing │ 349.4 │ 13.81 │ 11.21 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ express-graphql-dd-trace-less │ 319.8 │ 15.09 │ 2.01 │
├──────────────────────────────────────────┼────────────┼─────────┼───────────────┤
│ express-graphql-dd-trace │ 277.0 │ 17.51 │ 1.74 │
└──────────────────────────────────────────┴────────────┴─────────┴───────────────┘