benchmarks icon indicating copy to clipboard operation
benchmarks copied to clipboard

Add benchmarks for native NodeJS (LTS) server?

Open prescience-data opened this issue 1 year ago • 7 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

I might be misreading one of the existing labels which perhaps already provides this benchmark, but it would be great to get a benchmark for the native (LTS) NodeJS node:http server class.

Motivation

This would help when justifying the use of Fastify to stakeholders when presented with the "why not native?" question where native may be a reasonable option when provided the context of a performance differential.

Currently, I find myself leaning too heavily on "because we might need additional features in the future", which feels weak from a justification perspective, without knowing how much more (or less) performance might be gained from implementing the native server instead.

Example

An example would be when planning a small, simple http or websocket server for an internal application.

It's unknown or unlikely if more advanced features might be required in the future, but refactoring to Fastify in the event this occurs would be expensive.

Although certainly not the only factor within the decision matrix, the performance differential (especially if the result is better-than-native) would be a key consideration when calculating a cost/benefit EV of the comparison.

prescience-data avatar Sep 20 '22 03:09 prescience-data

Edit - after reading a blog regarding the Fastify benchmarks, is it correct to understand that "bare" is the native server?

source

If so, perhaps making this more explicit in the results table might be helpful for some as this wasn't immediately clear to me?

prescience-data avatar Sep 20 '22 03:09 prescience-data

Yes, bare is the native http server. Would you like to make a PR to keep this clearer?

mcollina avatar Sep 20 '22 05:09 mcollina

Yep will do that - I think just a minimal "(Node 14.x.x)" suffix should be enough if that sounds ok?

(I assume from reading the main page, this is the version used in the current benchmark?)

prescience-data avatar Sep 20 '22 07:09 prescience-data

I think that might be off too, check what versions the benchmarks are actually run. You can bring it up to v18.

mcollina avatar Sep 20 '22 07:09 mcollina

This is the correct entrypoint to the generator that produces the markdown yeah? https://github.com/fastify/benchmarks/blob/master/lib/packages.js

prescience-data avatar Sep 20 '22 07:09 prescience-data

Here is the actual version running against the benchmark.

https://github.com/fastify/benchmarks/blob/da0b9923549bbc3258e782b37e5d712e284cca65/.github/workflows/benchmarks.yml#L21

This is the correct entrypoint to the generator that produces the markdown yeah?

Yes, you can update the static version to process.version.

https://github.com/fastify/benchmarks/blob/da0b9923549bbc3258e782b37e5d712e284cca65/lib/packages.js#L7

climba03003 avatar Sep 20 '22 09:09 climba03003

Note that we should also update this to node v18

mcollina avatar Sep 20 '22 11:09 mcollina