Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor servers http #2560

Merged
merged 2 commits into from
Dec 30, 2023
Merged

Refactor servers http #2560

merged 2 commits into from
Dec 30, 2023

Conversation

Romakita
Copy link
Collaborator

Information

Type Breaking change
Feature No

Copy link

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v16.20.2
  • Run: Sat Dec 30 2023 11:30:20 GMT+0000 (Coordinated Universal Time)
  • Method: autocannon -c 100 -d 10 -p 10 localhost:3000 (two rounds; one to warm-up, one to measure)
Version Router Requests/s Latency Throughput/Mb
fastify 3.29.4 55555.2 17.51 9.91
nest-fastify 8.4.3 50291.2 19.37 8.97
koa 2.13.4 40301.1 24.30 7.19
fastify-injector 3.29.4 27951.3 35.24 6.37
express 4.18.1 12416.0 79.85 2.21
tsed-koa 7.53.0 11764.7 84.19 10.28
fastify-big-json 3.29.4 11305.1 87.69 130.05
nest 8.4.3 10389.5 95.45 2.50
express-injector 4.18.1 10078.6 98.37 2.30
tsed-express 7.53.0 9479.4 104.64 1.74
express-morgan 4.18.1 7296.9 136.01 1.30

Explanation

The benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance.

For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary.
It also initializes the elements necessary for monitoring requests in a log manager.

All this at a necessary cost that reflects the reality of a production application ;)

@Romakita Romakita merged commit 500c7f6 into production Dec 30, 2023
29 of 30 checks passed
@Romakita Romakita deleted the refactor-servers-http branch December 30, 2023 11:43
Copy link

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v16.20.2
  • Run: Sat Dec 30 2023 11:47:41 GMT+0000 (Coordinated Universal Time)
  • Method: autocannon -c 100 -d 10 -p 10 localhost:3000 (two rounds; one to warm-up, one to measure)
Version Router Requests/s Latency Throughput/Mb
fastify 3.29.4 55190.4 17.64 9.84
nest-fastify 8.4.3 48844.8 19.98 8.71
koa 2.13.4 39737.6 24.66 7.09
fastify-injector 3.29.4 29467.2 33.40 6.72
express 4.18.1 12039.6 82.24 2.15
tsed-koa 7.53.0 11961.1 82.80 10.45
fastify-big-json 3.29.4 11280.4 87.90 129.78
nest 8.4.3 10842.5 91.45 2.61
express-injector 4.18.1 10043.3 98.74 2.29
tsed-express 7.53.0 9650.4 102.77 1.77
express-morgan 4.18.1 7378.7 134.36 1.32

Explanation

The benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance.

For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary.
It also initializes the elements necessary for monitoring requests in a log manager.

All this at a necessary cost that reflects the reality of a production application ;)

@Romakita
Copy link
Collaborator Author

🎉 This PR is included in version 7.54.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant