curveball / core

The Curveball framework is a TypeScript framework for node.js with support for modern HTTP features.
https://curveballjs.org/
MIT License
526 stars 7 forks source link

Run a benchmark #130

Open motss opened 4 years ago

muturgan commented 4 years ago

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!

evert commented 4 years ago

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!

muturgan commented 4 years ago

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.

evert commented 4 years ago

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!