Skip to content

Instantly share code, notes, and snippets.

@puzpuzpuz
Created February 9, 2020 10:59
Show Gist options
  • Save puzpuzpuz/d7b3e6ca17baa241848ff1d15bce87aa to your computer and use it in GitHub Desktop.
Save puzpuzpuz/d7b3e6ca17baa241848ff1d15bce87aa to your computer and use it in GitHub Desktop.

Primitive benchmark comparison for JIT vs JITless Node.js web app

Benchmark environment:

JITless

Web app:

node --jitless ./examples/simple.js

Benchmark result:

$ npx autocannon -c 100 -d 30 -p 10 localhost:3000
Running 30s test @ http://localhost:3000
100 connections with 10 pipelining factor

┌─────────┬──────┬──────┬────────┬────────┬──────────┬──────────┬───────────┐
│ Stat    │ 2.5% │ 50%  │ 97.5%  │ 99%    │ Avg      │ Stdev    │ Max       │
├─────────┼──────┼──────┼────────┼────────┼──────────┼──────────┼───────────┤
│ Latency │ 0 ms │ 0 ms │ 158 ms │ 167 ms │ 15.38 ms │ 46.25 ms │ 225.72 ms │
└─────────┴──────┴──────┴────────┴────────┴──────────┴──────────┴───────────┘
┌───────────┬────────┬────────┬─────────┬─────────┬─────────┬─────────┬────────┐
│ Stat      │ 1%     │ 2.5%   │ 50%     │ 97.5%   │ Avg     │ Stdev   │ Min    │
├───────────┼────────┼────────┼─────────┼─────────┼─────────┼─────────┼────────┤
│ Req/Sec   │ 5919   │ 5919   │ 6487    │ 6675    │ 6412.14 │ 226.97  │ 5918   │
├───────────┼────────┼────────┼─────────┼─────────┼─────────┼─────────┼────────┤
│ Bytes/Sec │ 971 kB │ 971 kB │ 1.06 MB │ 1.09 MB │ 1.05 MB │ 37.2 kB │ 971 kB │
└───────────┴────────┴────────┴─────────┴─────────┴─────────┴─────────┴────────┘

Req/Bytes counts sampled once per second.

192k requests in 30.04s, 31.5 MB read

JIT

Web app:

node ./examples/simple.js

Benchmark result:

$ npx autocannon -c 100 -d 30 -p 10 localhost:3000
Running 30s test @ http://localhost:3000
100 connections with 10 pipelining factor

┌─────────┬──────┬──────┬───────┬───────┬─────────┬──────────┬───────────┐
│ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev    │ Max       │
├─────────┼──────┼──────┼───────┼───────┼─────────┼──────────┼───────────┤
│ Latency │ 0 ms │ 0 ms │ 54 ms │ 70 ms │ 5.45 ms │ 16.56 ms │ 160.85 ms │
└─────────┴──────┴──────┴───────┴───────┴─────────┴──────────┴───────────┘
┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
│ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
│ Req/Sec   │ 12103   │ 12103   │ 18223   │ 19727   │ 18080.94 │ 1264.78 │ 12101   │
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
│ Bytes/Sec │ 1.99 MB │ 1.99 MB │ 2.99 MB │ 3.23 MB │ 2.97 MB  │ 207 kB  │ 1.98 MB │
└───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘

Req/Bytes counts sampled once per second.

542k requests in 30.05s, 89 MB read

Result

As expected, even for a simple, syntetic web app the difference is noticeable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment