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

feat(agenda): support DIContext and allow manual job creation #2553

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

Romakita
Copy link
Collaborator

Information

Type Breaking change
Feature No

Add DIContext support and allow to create manually a job using $beforeAgendaStart and $afterAgendaStart hooks.

Todos

  • Tests
  • Coverage
  • Example
  • Documentation

Copy link

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v16.20.2
  • Run: Fri Dec 22 2023 08:09:37 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 57164.8 17.02 10.19
nest-fastify 8.4.3 48758.4 20.01 8.70
koa 2.13.4 40502.4 24.17 7.22
fastify-injector 3.29.4 28457.5 34.60 6.49
tsed-koa 7.52.0 12281.1 80.70 10.73
express 4.18.1 11898.4 83.31 2.12
fastify-big-json 3.29.4 11626.5 85.18 133.75
nest 8.4.3 10369.8 95.45 2.49
express-injector 4.18.1 10340.0 95.91 2.36
tsed-express 7.52.0 9533.5 104.04 1.75
express-morgan 4.18.1 7298.4 135.72 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 ;)

Copy link

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v16.20.2
  • Run: Fri Dec 22 2023 11:00:09 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 58144.0 16.71 10.37
nest-fastify 8.4.3 50419.2 19.35 8.99
koa 2.13.4 39001.6 25.14 6.96
fastify-injector 3.29.4 29635.6 33.22 6.76
express 4.18.1 12324.7 80.41 2.20
tsed-koa 7.52.0 11777.1 84.15 10.29
fastify-big-json 3.29.4 11327.6 87.51 130.32
nest 8.4.3 10863.6 91.28 2.61
express-injector 4.18.1 10299.2 96.22 2.35
tsed-express 7.52.0 9692.9 102.28 1.77
express-morgan 4.18.1 7428.4 133.45 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 ;)

@LorianeE LorianeE merged commit a1c6644 into production Dec 22, 2023
31 of 32 checks passed
@LorianeE LorianeE deleted the feat-agenda-expose-api branch December 22, 2023 11:02
@Romakita
Copy link
Collaborator Author

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

None yet

2 participants