core icon indicating copy to clipboard operation
core copied to clipboard

Run a benchmark

Open motss opened this issue 4 years ago • 4 comments

motss avatar Feb 28 '20 08:02 motss

just an exellent description...

but if it is interesting for somebody, there are my results of fastify/benchmarks: express

{
  "requests": {
    "sent": 1089238
  },
  "latency": {
    "average": 3.58
  },
  "throughput": {
    "average": 4597990.41
  },
  "errors": 0,
  "timeouts": 0,
  "duration": 40.04,
  "connections": 100,
  "pipelining": 10
}

fastify

{
  "requests": {
    "sent": 2246483
  },
  "latency": {
    "average": 1.7
  },
  "throughput": {
    "average": 9486950.4
  },
  "errors": 0,
  "timeouts": 0,
  "duration": 40.04,
  "connections": 100,
  "pipelining": 10
}

nest-fastify

{
  "requests": {
    "sent": 1861624
  },
  "latency": {
    "average": 2.07
  },
  "throughput": {
    "average": 7861324.8
  },
  "errors": 0,
  "timeouts": 0,
  "duration": 40.04,
  "connections": 100,
  "pipelining": 10
}

curveball

{
  "requests": {
    "sent": 1889003
  },
  "latency": {
    "average": 2.04
  },
  "throughput": {
    "average": 8684492.81
  },
  "errors": 0,
  "timeouts": 0,
  "duration": 40.04,
  "connections": 100,
  "pipelining": 10
}

So, curveball works as fast as nest-with-fastify. And that is really great result for me. At the same time a curveball based project will have much simpler file structure then a nest-based (that is pretty good for me). Moreover it allows you to use decorators at your controllers that like so many people (not me but really many).

Great job guys!

muturgan avatar Feb 29 '20 22:02 muturgan

Hi @muturgan ,

that's a fantastic result. Can you share something about the methodology? Perhaps you still have some of the code that you used to do the benchmark? It would be nice to publish this, but reproducibility seems important.

Thank you for doing this!

evert avatar Feb 29 '20 23:02 evert

sure

you can clone my fork of fastify/benchmarks: https://github.com/muturgan/benchmarks then checkout to the branch "my" install packages exec the "start" script

then you should looking to the "results" folder

i think it is a right way to make pull request into the fastify/benchmarks repo with a new curveball benchmark. but when i made it with other frameworks some time ago it was ignored. so i did not make it again with curveball.

the fastify/benchmarks have a MIT License so you can modify it as you want to benchmarking your project in different cases.

what about the methodology, it just checks the http implementation - tested frameworks instances just answer "hello world" to all get requests of specified endpoint without any logic.

muturgan avatar Mar 01 '20 01:03 muturgan

That's cool =) Given that the express benchmark doesn't have a controller, and is just a single function we might get some more speed by removing the controller. Regardless, this is cool. Thank you!

evert avatar Mar 01 '20 02:03 evert