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): fix generic serialization #2489

Conversation

Romakita
Copy link
Collaborator

Closes: #2478

@github-actions
Copy link

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.2
  • Run: Thu Oct 26 2023 07:38:11 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 50163.2 19.49 8.95
nest-fastify 8.4.3 44316.8 22.08 7.90
koa 2.13.4 38602.4 25.47 6.88
fastify-injector 3.29.4 24704.0 39.98 5.63
express 4.18.1 9921.8 99.95 1.77
tsed-koa 7.41.0 9122.7 108.76 7.97
nest 8.4.3 8500.2 116.66 2.04
fastify-big-json 3.29.4 8418.6 117.81 96.84
express-injector 4.18.1 7844.9 126.40 1.79
tsed-express 7.41.0 7049.6 140.40 1.29
express-morgan 4.18.1 5708.5 173.60 1.02

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 afc37c5 into production Oct 26, 2023
@Romakita Romakita deleted the 2478-bug-serialization-with-generic-pagination-items-are-not-serialized-correctly branch October 26, 2023 08:56
@Romakita
Copy link
Collaborator Author

🎉 This PR is included in version 7.41.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

}

class TestEntity {
@Property("id")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct usage of Property? I would have used @Name("id") 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arff true. But isn’t really important for our test ^^

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

Successfully merging this pull request may close these issues.

[BUG] Serialization with Generic Pagination. Items are not serialized correctly.
2 participants