https://github.com/eggjs/benchmark
benchmark for egg
https://github.com/eggjs/benchmark
egg
Last synced: 3 months ago
JSON representation
benchmark for egg
- Host: GitHub
- URL: https://github.com/eggjs/benchmark
- Owner: eggjs
- Created: 2016-07-20T15:24:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-08-01T10:04:34.000Z (5 months ago)
- Last Synced: 2025-09-17T12:44:48.612Z (4 months ago)
- Topics: egg
- Language: JavaScript
- Homepage: https://eggjs.github.io/benchmark/plot/
- Size: 68.4 KB
- Stars: 20
- Watchers: 10
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# benchmark
egg benchmark
## Commands
* `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
* `./plot.sh` 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
## Scenes
- 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`
## Scripts
- koa1: `wrk http://127.0.0.1:7001/ -d 10 -c 50 -t 8`
- koa2: `wrk http://127.0.0.1:7002/ -d 10 -c 50 -t 8`
- egg1: `wrk http://127.0.0.1:7003/ -d 10 -c 50 -t 8`
- egg2: `wrk http://127.0.0.1:7004/ -d 10 -c 50 -t 8`
- egg3: `wrk http://127.0.0.1:7005/ -d 10 -c 50 -t 8`
- egg3 with worker_threads: `wrk http://127.0.0.1:7006/ -d 10 -c 50 -t 8`
## Server
- MacBook Pro (Retina, 15-inch, Late 2013)
- 2 GHz Intel Core i7 (only use 4 core for benchmark)
## CPU Profiler

## Known issues
- `Date.now()` cost a lot of CPU time(7%) in `meta` middleware and `CreateContext` method.
## Last Results
- [Visualization](https://eggjs.github.io/benchmark/plot/)
- [Statistics data](https://github.com/eggjs/benchmark/blob/master/plot/all.csv)