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(json-mapper): prefix var to avoid var declaration that use reserved keyword in js (enum, default, etc...) #2449

Merged

Conversation

Romakita
Copy link
Collaborator

Closes: #2448

…ed keyword in js (enum, default, etc...)

Closes: #2448
@github-actions
Copy link

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.2
  • Run: Wed Sep 27 2023 15:12:14 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 52406.4 18.65 9.34
nest-fastify 8.4.3 47577.6 20.59 8.49
koa 2.13.4 38674.4 25.38 6.90
fastify-injector 3.29.4 26092.4 37.80 5.95
express 4.18.1 9959.8 99.51 1.78
tsed-koa 7.36.3 9099.8 108.91 7.95
fastify-big-json 3.29.4 8798.2 112.56 101.22
nest 8.4.3 8767.4 113.29 2.11
express-injector 4.18.1 7946.2 124.74 1.81
tsed-express 7.36.3 7386.4 134.14 1.35
express-morgan 4.18.1 5806.8 170.56 1.04

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 1819773 into production Sep 27, 2023
36 checks passed
@Romakita Romakita deleted the fix-2448-json-mapper-avoid-error-on-reserved-keyword branch September 27, 2023 15:33
@Romakita
Copy link
Collaborator Author

🎉 This PR is included in version 7.36.4 🎉

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
1 participant