Clone or download


build status

egg benchmark


  • npm test to run all the benchmarks and store the results in stats.csv (requires wrk), also you can open plot/index.html to see the results
  • ./ to compare performance between the latest releases of Node.js v7.x, v8.x, rc, nightly and v8-canary (requires wrk and nvm), then open plot/index.html to see the results
    • Requires AJAX privilege to load data from plot/all.csv, you can run python -m SimpleHTTPServer then visit http://localhost:8000/plot/ (or use any other static server) if you don't want to tweak browser settings

Default Middleware

  • egg default enable 15 middlewares (6 security middlewares enable by default)
  • enable router
  • passport has 17 middlewares (15 default, 2 passport middlewares)
  • csrf are disabled, because in most situation we won't caculate csrf token and set to cookie


  • Hello World: $ EGG_SERVER_ENV=prod node benchmarks/simple/dispatch.js
  • nunjucks: $ EGG_SERVER_ENV=prod node benchmarks/simple_view/dispatch.js
  • Empty passport: $ EGG_SERVER_ENV=prod node benchmarks/simple_passport/dispatch.js


  • koa1: wrk -d 10 -c 50 -t 8
  • koa2: wrk -d 10 -c 50 -t 8
  • egg1: wrk -d 10 -c 50 -t 8
  • egg2: wrk -d 10 -c 50 -t 8


  • MacBook Pro (Retina, 15-inch, Late 2013)
  • 2 GHz Intel Core i7 (only use 4 core for benchmark)

CPU Profiler


Known issues

  • cost a lot of CPU time(7%) in meta middleware and CreateContext method.

Last Results