Giter VIP home page Giter VIP logo

frameworks-benchmark's Introduction

Benchmark of some http frameworks

Three routes are tested :

  • /big : return a big json object (354Ko)
  • /small : return a small json object (2Ko)
  • /hello : return {hello : 'world'}

Data sent back by both /big and /small routes are real-world data (anonymized) corresponding some of our real application responses.

Results

Updated 19/09/2017

Node : 8.5.0
Pc : Intel(R) Core i7-6500U CPU 2.50GHZ 2.59GHZ 8.00Go RAM
OS : Windows 10

3 runs : only the results of third run are kept.

express 4.15.4

npm run test-perf-express

> [email protected] test-perf-express C:\node-projects\frameworks-benchmark
> autocannon -c 100 -d 5 localhost:3000/big && autocannon -c 100 -d 5 localhost:3000/small && autocannon -c 100 -d 5 localhost:3000/
hello

Running 5s test @ http://localhost:3000/big
100 connections

Stat         Avg     Stdev   Max
Latency (ms) 169.47  50.65   379
Req/Sec      577.6   23.07   601
Bytes/Sec    98.6 MB 4.59 MB 105 MB

3k requests in 5s, 493 MB read

Running 5s test @ http://localhost:3000/small
100 connections

Stat         Avg     Stdev   Max
Latency (ms) 9.15    3.32    49
Req/Sec      10336.4 1511.37 11119
Bytes/Sec    8.89 MB 1.38 MB 9.96 MB

52k requests in 5s, 44.1 MB read

Running 5s test @ http://localhost:3000/hello
100 connections

Stat         Avg     Stdev  Max
Latency (ms) 8.12    2.95   43
Req/Sec      11610.4 832.47 12383
Bytes/Sec    2.16 MB 156 kB 2.36 MB

58k requests in 5s, 10.9 MB read

fastify 0.27

$ npm run test-perf-fastify

> [email protected] test-perf-fastify C:\node-projects\frameworks-benchmark
> autocannon -c 100 -d 5 localhost:3000/big && autocannon -c 100 -d 5 localhost:3000/bigschema && autocannon -c 100 -d 5 localhost:3
000/small && autocannon -c 100 -d 5 localhost:3000/hello

Running 5s test @ http://localhost:3000/big
100 connections

Stat         Avg    Stdev   Max
Latency (ms) 194.49 13.32   238
Req/Sec      507.8  26.2    533
Bytes/Sec    86 MB  4.59 MB 92.3 MB

3k requests in 5s, 434 MB read

Running 5s test @ http://localhost:3000/bigschema
100 connections

Stat         Avg     Stdev   Max
Latency (ms) 171.4   10.6    215
Req/Sec      580.21  39.6    600
Bytes/Sec    70.7 MB 5.45 MB 75.5 MB

3k requests in 5s, 345 MB read

Running 5s test @ http://localhost:3000/small
100 connections

Stat         Avg     Stdev   Max
Latency (ms) 4.04    1.55    37
Req/Sec      22388.8 1850.55 23535
Bytes/Sec    18.6 MB 1.57 MB 19.9 MB

112k requests in 5s, 91.2 MB read

Running 5s test @ http://localhost:3000/hello
100 connections

Stat         Avg     Stdev   Max
Latency (ms) 2.96    1.45    39
Req/Sec      28804.8 2243.12 30671
Bytes/Sec    4.29 MB 360 kB  4.72 MB

144k requests in 5s, 21.5 MB read

Conclusion

  • Fastify is much faster then Express in 'small' and 'hello' tests (roughly x2 performance)
  • However concerning the 'big' test, Express is sligthly better.
  • With big response, Fastify can only match Express performance by using schema validation (route /bigschema in the tests) which allows to enable faster Json stringification

frameworks-benchmark's People

Contributors

abenhamdine avatar renovate-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

frameworks-benchmark's Issues

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • autocannon ^0
  • express ^4
  • fastify ^1.0.0
  • uws ^10.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Should express features fastify doesn't have be turned off?

Just a general question I usually see in benchmarks: should all the on-by-default features in Express that are not implemented in Fastify be turned off in the Express example? I'm sure this won't make Express faster, because there is a lot you can't turn off, but things like the ETag generation usually takes a perf hit, and AFAIK Fastify doesn't implement ETag OOB. app.disable('etag') disables that feature in Express, for example.

Dependency deprecation warning: uws (npm)

On registry https://registry.npmjs.org/, the "latest" version (v99.0.0) of dependency uws has the following deprecation notice:

stop using this version

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about uws's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.