/node-graphql-benchmarks

Benchmarks for different Node.js GraphQL Servers

Primary LanguageJavaScriptMIT LicenseMIT

TL;DR

  • graphql-jit helps
  • apollo-server adds overhead
  • tracing resolvers kills performance
  • type-graphql adds overhead

Explanation

For further details, please check out this video.

Usage

git clone https://github.com/benawad/benchmarks
cd benchmarks
npm install
npm start

Benchmarks

duration: 5s connections: 5 pipelining: 1

Server Requests/s Latency Throughput/Mb
core-graphql-jit-buf-fjs 6725.2 0.06 41.65
uWebSockets-graphql+jit 6654.8 0.05 40.96
core-graphql-jit-str 6563.6 0.07 40.65
core-graphql-jit-buf 6514.8 0.06 40.35
fastify-REST 6347.6 0.06 50.75
benzene-server 6086.0 0.11 37.98
benzene-server+express 5559.6 0.16 34.82
express-REST 5116.4 0.21 41.25
express-gql 3992.0 1.06 25.16
graphql-api-koa+graphql-jit 3354.2 1.04 20.90
express-graphql+graphql-jit+graphql-compose 3081.4 1.06 19.42
express-graphql+graphql-jit 3011.0 1.08 18.97
fastify-express-graphql-jit 2959.4 1.11 0.75
mercurius+graphql-jit 2950.2 1.11 18.40
mercurius 2947.0 1.11 18.39
mercurius+graphql-compose 2938.6 1.09 18.33
fastify-express-graphql-typed-jit 2864.6 1.09 0.72
mercurius+graphql-jit+type-graphql 2856.2 1.11 17.82
apollo-server-fastify+graphql-jit 2784.6 1.19 17.45
express-graphql+graphql-jit+type-graphql 2736.6 1.15 17.24
graphql-api-koa 2102.6 2.06 13.10
express-graphql+graphql-compose 1993.6 2.09 12.56
apollo-server-koa+graphql-jit+type-graphql 1976.4 2.21 12.33
graphql-compose+async 1938.6 2.10 12.22
express-graphql 1930.2 2.13 12.17
fastify-express-grapql-typed 1916.2 2.10 0.48
apollo-server-fastify 1903.8 2.12 11.94
yoga-graphql 1843.8 2.22 11.57
express-graphql+type-graphql 1832.0 2.20 11.55
type-graphql+async 1828.8 2.17 11.53
apollo-schema+async 1806.6 2.25 11.39
type-graphql+middleware 1798.0 2.19 11.33
type-graphql+async-middleware 1757.2 2.25 11.08
express-graphql-dd-trace-no-plugin 1608.6 2.48 10.14
apollo-server-express 1436.2 3.14 9.10
yoga-graphql-trace 1088.8 4.06 34.61
apollo-opentracing 990.2 4.64 6.27
express-graphql-dd-trace-less 935.6 4.77 5.90
express-graphql-dd-trace 901.2 5.01 5.68
apollo-server-express-tracing 799.4 5.72 25.46