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(di): make @tsed/di compatible with browser env #2361

Merged
merged 5 commits into from
Jul 6, 2023
Merged

Conversation

Romakita
Copy link
Collaborator

No description provided.

@github-actions
Copy link

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.0
  • Run: Mon Jun 26 2023 09:01:10 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 28008.0 35.32 5.00
nest-fastify 8.4.3 25393.6 39.01 4.53
koa 2.13.4 21726.4 45.58 3.87
fastify-injector 3.29.4 17099.6 57.90 3.90
fastify-big-json 3.29.4 6757.6 146.75 77.74
express 4.18.1 6184.6 160.25 1.10
tsed-koa 7.30.0 5715.2 173.81 4.99
nest 8.4.3 5265.3 188.18 1.27
express-injector 4.18.1 5160.3 192.00 1.18
tsed-express 7.30.0 4817.7 205.74 0.88
express-morgan 4.18.1 3693.4 266.88 0.66

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

@github-actions
Copy link

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.0
  • Run: Mon Jun 26 2023 09:41:05 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 50912.0 19.18 9.08
nest-fastify 8.4.3 48051.2 20.34 8.57
koa 2.13.4 39891.2 24.60 7.11
fastify-injector 3.29.4 26344.0 37.43 6.00
express 4.18.1 10336.8 95.92 1.84
tsed-koa 7.31.0-rc.1 9461.3 104.66 8.26
nest 8.4.3 8906.0 111.74 2.14
fastify-big-json 3.29.4 8900.6 111.65 102.39
express-injector 4.18.1 8013.4 123.62 1.83
tsed-express 7.31.0-rc.1 7410.7 133.82 1.36
express-morgan 4.18.1 5899.6 167.31 1.05

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

@github-actions
Copy link

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.0
  • Run: Mon Jun 26 2023 09:48:04 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 56828.8 17.14 10.13
nest-fastify 8.4.3 50944.0 19.14 9.09
koa 2.13.4 42700.8 22.92 7.62
fastify-injector 3.29.4 29632.0 33.25 6.75
express 4.18.1 11651.2 85.07 2.08
fastify-big-json 3.29.4 10773.6 92.18 123.95
tsed-koa 7.31.0-rc.1 10622.4 93.38 9.28
nest 8.4.3 10380.2 95.43 2.49
express-injector 4.18.1 9606.2 103.23 2.19
tsed-express 7.31.0-rc.1 8718.7 113.75 1.60
express-morgan 4.18.1 6915.8 143.55 1.23

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

@github-actions
Copy link

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.0
  • Run: Mon Jun 26 2023 10:02:19 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 43072.0 22.84 7.68
nest-fastify 8.4.3 40168.8 24.46 7.16
koa 2.13.4 33584.0 29.33 5.99
fastify-injector 3.29.4 21746.0 45.44 4.96
express 4.18.1 8061.8 122.99 1.44
tsed-koa 7.31.0-rc.1 7835.2 126.54 6.84
fastify-big-json 3.29.4 7530.8 132.12 86.63
nest 8.4.3 6740.8 146.87 1.62
express-injector 4.18.1 6636.0 149.38 1.51
tsed-express 7.31.0-rc.1 6148.6 161.18 1.13
express-morgan 4.18.1 4665.9 212.37 0.83

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

@github-actions
Copy link

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.0
  • Run: Mon Jun 26 2023 10:06: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 59385.6 16.35 10.59
nest-fastify 8.4.3 52979.2 18.41 9.45
koa 2.13.4 44524.8 21.95 7.94
fastify-injector 3.29.4 29752.0 33.11 6.78
express 4.18.1 11692.0 84.79 2.08
fastify-big-json 3.29.4 11056.8 89.90 127.21
tsed-koa 7.31.0-rc.1 10647.6 93.12 9.30
nest 8.4.3 10585.1 93.63 2.54
express-injector 4.18.1 9561.0 103.69 2.18
tsed-express 7.31.0-rc.1 8715.5 113.73 1.60
express-morgan 4.18.1 6982.0 142.16 1.24

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

@github-actions
Copy link

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.0
  • Run: Mon Jun 26 2023 13:52:54 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 27064.0 36.49 4.83
nest-fastify 8.4.3 24089.6 41.02 4.30
koa 2.13.4 21681.6 45.64 3.87
fastify-injector 3.29.4 16063.2 61.73 3.66
fastify-big-json 3.29.4 6596.4 150.73 75.88
express 4.18.1 6477.3 153.01 1.16
tsed-koa 7.31.0-rc.1 5329.3 186.01 4.65
nest 8.4.3 5190.8 190.78 1.25
express-injector 4.18.1 5011.5 198.03 1.14
tsed-express 7.31.0-rc.1 4632.5 213.91 0.85
express-morgan 4.18.1 3632.8 271.78 0.65

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

# Conflicts:
#	lerna.json
#	package.json
#	packages/core/package.json
#	packages/di/package.json
#	packages/engines/package.json
#	packages/graphql/apollo/package.json
#	packages/graphql/typegraphql/package.json
#	packages/orm/adapters-redis/package.json
#	packages/orm/adapters/package.json
#	packages/orm/ioredis/package.json
#	packages/orm/mikro-orm/package.json
#	packages/orm/mongoose/package.json
#	packages/orm/objection/package.json
#	packages/orm/prisma/package.json
#	packages/orm/testing-mongoose/package.json
#	packages/orm/typeorm/package.json
#	packages/perf/package.json
#	packages/platform/common/package.json
#	packages/platform/platform-cache/package.json
#	packages/platform/platform-exceptions/package.json
#	packages/platform/platform-express/package.json
#	packages/platform/platform-koa/package.json
#	packages/platform/platform-log-middleware/package.json
#	packages/platform/platform-middlewares/package.json
#	packages/platform/platform-params/package.json
#	packages/platform/platform-response-filter/package.json
#	packages/platform/platform-router/package.json
#	packages/platform/platform-serverless-http/package.json
#	packages/platform/platform-serverless-testing/package.json
#	packages/platform/platform-serverless/package.json
#	packages/platform/platform-test-sdk/package.json
#	packages/platform/platform-views/package.json
#	packages/security/jwks/package.json
#	packages/security/oidc-provider-plugin-wildcard-redirect-uri/package.json
#	packages/security/oidc-provider/package.json
#	packages/security/passport/package.json
#	packages/specs/ajv/package.json
#	packages/specs/exceptions/package.json
#	packages/specs/json-mapper/package.json
#	packages/specs/openspec/package.json
#	packages/specs/schema/package.json
#	packages/specs/swagger/package.json
#	packages/third-parties/agenda/package.json
#	packages/third-parties/components-scan/package.json
#	packages/third-parties/event-emitter/package.json
#	packages/third-parties/formio-types/package.json
#	packages/third-parties/formio/package.json
#	packages/third-parties/schema-formio/package.json
#	packages/third-parties/socketio-testing/package.json
#	packages/third-parties/socketio/package.json
#	packages/third-parties/stripe/package.json
#	packages/third-parties/terminus/package.json
#	packages/third-parties/vite-ssr-plugin/package.json
#	packages/utils/normalize-path/package.json
#	tools/eslint/package.json
#	tools/github-sponsors/package.json
#	tools/integration/package.json
#	tools/jest/package.json
#	tools/mocha/package.json
#	tools/typescript/package.json
#	tools/webpack/package.json
@github-actions
Copy link

github-actions bot commented Jul 6, 2023

Benchmarks

  • Machine: linux x64 | 2 vCPUs | 6.8GB Mem
  • Node: v16.20.1
  • Run: Thu Jul 06 2023 05:39:35 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 55648.0 17.52 9.92
nest-fastify 8.4.3 49555.2 19.69 8.84
koa 2.13.4 42640.0 22.96 7.61
fastify-injector 3.29.4 27931.2 35.31 6.37
express 4.18.1 11401.1 87.00 2.03
fastify-big-json 3.29.4 10559.2 93.89 121.49
tsed-koa 7.31.0-rc.1 10452.7 94.82 9.13
nest 8.4.3 10416.0 95.23 2.50
express-injector 4.18.1 9431.8 105.26 2.15
tsed-express 7.31.0-rc.1 8532.9 116.23 1.56
express-morgan 4.18.1 6870.0 144.23 1.23

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 85065ad into production Jul 6, 2023
35 of 36 checks passed
@Romakita Romakita deleted the rc branch July 6, 2023 06:23
Romakita added a commit that referenced this pull request Jul 6, 2023
* feat(di): make @tsed/di compatible with browser env

* Github CI build: __run_2 v7.31.0-rc.1 [ci skip]

* fix(core): revert proxyDelegation

* feat(event-emitter): make @tsed/event-emitter compatible with browser env

---------

Co-authored-by: semantic-release-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants