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

fix(di): change injector.resolve() visibility from private to protected #2367

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

Romakita
Copy link
Collaborator

@Romakita Romakita commented Jul 3, 2023

Information

Type Breaking change
Fix No

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.1
  • Run: Mon Jul 03 2023 14:01:55 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 30486.4 32.50 5.44
nest-fastify 8.4.3 24724.8 40.02 4.41
koa 2.13.4 22091.2 44.72 3.94
fastify-injector 3.29.4 17078.0 57.96 3.89
fastify-big-json 3.29.4 6359.6 155.83 73.15
tsed-koa 7.30.1 5203.6 190.21 4.55
nest 8.4.3 5146.3 192.23 1.24
express-injector 4.18.1 5127.9 193.46 1.17
express 4.18.1 4983.0 199.01 0.89
tsed-express 7.30.1 4616.5 213.51 0.85
express-morgan 4.18.1 3834.3 257.40 0.68

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 c3c26f4 into production Jul 3, 2023
@Romakita Romakita deleted the fix-di-resolve-to-protected branch July 3, 2023 20:34
@Romakita
Copy link
Collaborator Author

Romakita commented Jul 3, 2023

🎉 This PR is included in version 7.30.3 🎉

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