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(common): refactoring PlatformBuilder fo Fastify #2564

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

Romakita
Copy link
Collaborator

@Romakita Romakita commented Jan 3, 2024

No description provided.

@Romakita Romakita force-pushed the fix-platform-builder branch 2 times, most recently from 4d522e8 to b0661bd Compare January 3, 2024 08:51
Copy link

github-actions bot commented Jan 3, 2024

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v16.20.2
  • Run: Wed Jan 03 2024 08:52:24 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 56412.8 17.22 10.06
nest-fastify 8.4.3 49062.4 19.92 8.75
koa 2.13.4 39158.4 25.04 6.98
fastify-injector 3.29.4 27625.6 35.62 6.30
express 4.18.1 12398.9 79.94 2.21
tsed-koa 7.54.0 11817.8 83.85 10.32
fastify-big-json 3.29.4 11542.4 85.86 132.81
nest 8.4.3 11234.5 88.12 2.70
express-injector 4.18.1 10249.8 96.76 2.34
tsed-express 7.54.0 9699.0 102.20 1.78
express-morgan 4.18.1 7145.8 138.49 1.27

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 ;)

Copy link

github-actions bot commented Jan 3, 2024

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v16.20.2
  • Run: Wed Jan 03 2024 09:06: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 55004.8 17.69 9.81
nest-fastify 8.4.3 50796.8 19.19 9.06
koa 2.13.4 38240.0 25.63 6.82
fastify-injector 3.29.4 28481.6 34.59 6.49
express 4.18.1 12036.8 82.22 2.15
tsed-koa 7.54.0 11740.7 84.45 10.26
fastify-big-json 3.29.4 11368.4 87.19 130.78
nest 8.4.3 10708.8 92.56 2.57
express-injector 4.18.1 10113.1 97.94 2.31
tsed-express 7.54.0 9458.7 104.73 1.73
express-morgan 4.18.1 7092.4 139.47 1.26

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 force-pushed the fix-platform-builder branch from b0661bd to f6603eb Compare January 3, 2024 11:02
Copy link

github-actions bot commented Jan 3, 2024

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v16.20.2
  • Run: Wed Jan 03 2024 11:12:08 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 55584.0 17.52 9.91
nest-fastify 8.4.3 48176.0 20.25 8.59
koa 2.13.4 39078.4 25.08 6.97
fastify-injector 3.29.4 28160.0 35.00 6.42
express 4.18.1 12262.9 80.87 2.19
fastify-big-json 3.29.4 11644.0 85.04 133.96
tsed-koa 7.55.0 11540.0 85.81 10.08
nest 8.4.3 10828.8 91.47 2.60
express-injector 4.18.1 10144.8 97.69 2.31
tsed-express 7.55.0 9419.8 105.12 1.72
express-morgan 4.18.1 7026.0 140.77 1.25

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 32384bb into production Jan 3, 2024
34 checks passed
@Romakita Romakita deleted the fix-platform-builder branch January 3, 2024 12:42
@Romakita
Copy link
Collaborator Author

🎉 This PR is included in version 7.56.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