Skip to content

Move getActivations to ResolutionContext#1999

Merged
notaphplover merged 1 commit into
mainfrom
refactor/move-get-activations-to-resolution-context
Jul 16, 2026
Merged

Move getActivations to ResolutionContext#1999
notaphplover merged 1 commit into
mainfrom
refactor/move-get-activations-to-resolution-context

Conversation

@notaphplover

@notaphplover notaphplover commented Jul 16, 2026

Copy link
Copy Markdown
Member

Changed

  • Moved getActivations to ResolutionContext.

Summary by CodeRabbit

  • Breaking Changes

    • Moved getActivations from ResolutionParams to ResolutionContext.
    • Updated the package with a major version release to reflect this API change.
  • Bug Fixes

    • Updated activation resolution to consistently use the new context-based API for synchronous and asynchronous services.
  • Tests

    • Expanded coverage for activation lookup, including undefined results and promise-based resolution scenarios.

@notaphplover notaphplover self-assigned this Jul 16, 2026
@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4ecb0b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@inversifyjs/core Major
@inversifyjs/container Patch
inversify Patch
@inversifyjs/plugin-dispose Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

getActivations moves from ResolutionParams to ResolutionContext. Service resolution wiring, activation resolvers, integration fixtures, unit tests, and the core changeset are updated to use the new location.

Changes

Activation context migration

Layer / File(s) Summary
Resolution contract update
.changeset/cyan-groups-spend.md, packages/container/libraries/core/src/resolution/models/*
ResolutionContext now exposes getActivations, while ResolutionParams no longer does; the changeset records a major version and breaking API move.
Resolution context wiring
packages/container/libraries/container/src/container/services/*, packages/container/libraries/core/src/resolution/actions/resolve.int.spec.ts
ServiceResolutionManager builds a shared context containing getActivations, removes the duplicate top-level parameter, and updates resolution expectations and integration setup.
Context-based activation lookup
packages/container/libraries/core/src/resolution/actions/*
Service and binding activation resolvers call params.context.getActivations, with synchronous, asynchronous, undefined, delegation, and error-path tests updated accordingly.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: moving getActivations to ResolutionContext.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/move-get-activations-to-resolution-context

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/container/libraries/core/src/resolution/actions/resolve.int.spec.ts (1)

400-404: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Align type signature with ResolutionContext.

The getActivations implementation here can be updated to perfectly match the ResolutionContext interface by passing the TActivated generic parameter to ServiceIdentifier and using Iterable instead of an array.

♻️ Proposed refactor
       getActivations: <TActivated>(
-        serviceIdentifier: ServiceIdentifier,
-      ): BindingActivation<TActivated>[] | undefined =>
+        serviceIdentifier: ServiceIdentifier<TActivated>,
+      ): Iterable<BindingActivation<TActivated>> | undefined =>
         activationService.get(serviceIdentifier) as
-          BindingActivation<TActivated>[] | undefined,
+          Iterable<BindingActivation<TActivated>> | undefined,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/container/libraries/core/src/resolution/actions/resolve.int.spec.ts`
around lines 400 - 404, Update the getActivations implementation to match the
ResolutionContext signature: make ServiceIdentifier generic over TActivated and
return Iterable<BindingActivation<TActivated>> rather than an array, while
preserving the existing activationService lookup and cast behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@packages/container/libraries/core/src/resolution/actions/resolve.int.spec.ts`:
- Around line 400-404: Update the getActivations implementation to match the
ResolutionContext signature: make ServiceIdentifier generic over TActivated and
return Iterable<BindingActivation<TActivated>> rather than an array, while
preserving the existing activationService lookup and cast behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 762a39e5-24e6-4a1a-a511-9df7804210d3

📥 Commits

Reviewing files that changed from the base of the PR and between d0b6022 and 4ecb0b2.

📒 Files selected for processing (12)
  • .changeset/cyan-groups-spend.md
  • packages/container/libraries/container/src/container/services/ServiceResolutionManager.spec.ts
  • packages/container/libraries/container/src/container/services/ServiceResolutionManager.ts
  • packages/container/libraries/core/src/planning/calculations/handleResolveError.spec.ts
  • packages/container/libraries/core/src/resolution/actions/resolve.int.spec.ts
  • packages/container/libraries/core/src/resolution/actions/resolveBindingActivations.spec.ts
  • packages/container/libraries/core/src/resolution/actions/resolveBindingServiceActivations.spec.ts
  • packages/container/libraries/core/src/resolution/actions/resolveBindingServiceActivations.ts
  • packages/container/libraries/core/src/resolution/actions/resolveServiceActivations.spec.ts
  • packages/container/libraries/core/src/resolution/actions/resolveServiceActivations.ts
  • packages/container/libraries/core/src/resolution/models/ResolutionContext.ts
  • packages/container/libraries/core/src/resolution/models/ResolutionParams.ts
💤 Files with no reviewable changes (3)
  • packages/container/libraries/core/src/planning/calculations/handleResolveError.spec.ts
  • packages/container/libraries/core/src/resolution/models/ResolutionParams.ts
  • packages/container/libraries/core/src/resolution/actions/resolveBindingActivations.spec.ts

@github-actions

Copy link
Copy Markdown
Contributor

Benchmarks results:

[CJS] Running benchmarks...

Get service in singleton scope
┌─────────┬──────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''245.05 ± 0.13%''230.00 ± 9.00''4230125 ± 0.01%''4347826 ± 177061'     │ 4080754 │
│ 1       │ 'inversifyCurrent (Jitless)''250.05 ± 0.13%''231.00 ± 9.00''4160886 ± 0.01%''4329004 ± 162338'     │ 3999278 │
│ 2       │ 'inversify6''1088.9 ± 0.24%''1002.0 ± 21.00''961943 ± 0.02%''998004 ± 21364'       │ 918333  │
│ 3       │ 'inversify7''310.60 ± 0.14%''291.00 ± 10.00''3338587 ± 0.01%''3436426 ± 122293'     │ 3219546 │
│ 4       │ 'inversify8''240.75 ± 0.12%''221.00 ± 9.00''4314668 ± 0.01%''4524887 ± 177061'     │ 4153626 │
│ 5       │ 'awilix''230.63 ± 0.21%''211.00 ± 10.00''4555881 ± 0.01%''4739337 ± 214450'     │ 4336032 │
│ 6       │ 'NestJS''323.74 ± 0.29%''301.00 ± 9.00''3212705 ± 0.01%''3322259 ± 96453'      │ 3088900 │
│ 7       │ 'tsyringe''322.83 ± 0.27%''301.00 ± 10.00''3231650 ± 0.01%''3322259 ± 106825'     │ 3097618 │
└─────────┴──────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.017x
inversifyCurrent vs inversify6 Speedup: 4.397x
inversifyCurrent vs inversify7 Speedup: 1.267x
inversifyCurrent vs inversify8 Speedup: 0.980x
inversifyCurrent vs awilix Speedup: 0.928x
inversifyCurrent vs NestJS Speedup: 1.317x
inversifyCurrent vs tsyringe Speedup: 1.309x

Get service in transient scope
┌─────────┬──────────────────────────────┬──────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns) │ Latency med (ns)  │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼──────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''314.55 ± 0.25%''290.00 ± 10.00''3361185 ± 0.02%''3448276 ± 123153'     │ 3179167 │
│ 1       │ 'inversifyCurrent (Jitless)''356.09 ± 0.21%''341.00 ± 10.00''2899063 ± 0.01%''2932551 ± 88597'      │ 2808268 │
│ 2       │ 'inversify6''6002.9 ± 0.27%''5371.0 ± 101.00''176409 ± 0.08%''186185 ± 3568'        │ 166585  │
│ 3       │ 'inversify7''613.19 ± 0.13%''582.00 ± 9.00''1678892 ± 0.01%''1718213 ± 26166'      │ 1630812 │
│ 4       │ 'inversify8''300.99 ± 0.22%''281.00 ± 9.00''3453615 ± 0.01%''3558719 ± 110443'     │ 3322325 │
│ 5       │ 'awilix''437.38 ± 0.27%''411.00 ± 10.00''2365564 ± 0.01%''2433090 ± 57793'      │ 2286367 │
│ 6       │ 'NestJS''10972 ± 2.04%''9407.0 ± 270.00''101397 ± 0.10%''106304 ± 3022'        │ 91145   │
│ 7       │ 'tsyringe''461.42 ± 0.13%''440.00 ± 10.00''2239334 ± 0.01%''2272727 ± 52854'      │ 2167244 │
└─────────┴──────────────────────────────┴──────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.159x
inversifyCurrent vs inversify6 Speedup: 19.053x
inversifyCurrent vs inversify7 Speedup: 2.002x
inversifyCurrent vs inversify8 Speedup: 0.973x
inversifyCurrent vs awilix Speedup: 1.421x
inversifyCurrent vs NestJS Speedup: 33.149x
inversifyCurrent vs tsyringe Speedup: 1.501x

Get wide service in transient scope
┌─────────┬──────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''580.03 ± 0.32%''551.00 ± 10.00''1788549 ± 0.01%''1814882 ± 33547'      │ 1724040 │
│ 1       │ 'inversifyCurrent (Jitless)''962.24 ± 0.24%''912.00 ± 10.00''1072138 ± 0.02%''1096491 ± 11893'      │ 1039245 │
│ 2       │ 'inversify6''26233 ± 0.36%''24557 ± 211.00''39353 ± 0.12%''40722 ± 353'          │ 38120   │
│ 3       │ 'inversify7''1643.8 ± 0.26%''1573.0 ± 10.00''626803 ± 0.02%''635728 ± 4067'        │ 608357  │
│ 4       │ 'inversify8''781.08 ± 0.27%''742.00 ± 10.00''1323147 ± 0.01%''1347709 ± 18411'      │ 1280284 │
│ 5       │ 'awilix''1304.9 ± 0.14%''1263.0 ± 11.00''781482 ± 0.01%''791766 ± 6956'        │ 766352  │
│ 6       │ 'NestJS''24640 ± 1.38%''22072 ± 441.00''43586 ± 0.13%''45306 ± 907'          │ 40585   │
│ 7       │ 'tsyringe''1348.6 ± 0.20%''1293.0 ± 11.00''759441 ± 0.02%''773395 ± 6636'        │ 741498  │
└─────────┴──────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.668x
inversifyCurrent vs inversify6 Speedup: 45.449x
inversifyCurrent vs inversify7 Speedup: 2.853x
inversifyCurrent vs inversify8 Speedup: 1.352x
inversifyCurrent vs awilix Speedup: 2.289x
inversifyCurrent vs NestJS Speedup: 41.035x
inversifyCurrent vs tsyringe Speedup: 2.355x

Get complex service in singleton scope
┌─────────┬──────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''267.62 ± 0.25%''251.00 ± 9.00''3862314 ± 0.01%''3984064 ± 137910'     │ 3736630 │
│ 1       │ 'inversifyCurrent (Jitless)''266.42 ± 0.17%''251.00 ± 9.00''3884279 ± 0.01%''3984064 ± 137910'     │ 3753420 │
│ 2       │ 'inversify6''1117.5 ± 1.53%''1032.0 ± 30.00''936193 ± 0.02%''968992 ± 29012'       │ 894883  │
│ 3       │ 'inversify7''316.38 ± 0.28%''291.00 ± 10.00''3306587 ± 0.01%''3436426 ± 114167'     │ 3160719 │
│ 4       │ 'inversify8''274.55 ± 0.15%''260.00 ± 9.00''3764216 ± 0.01%''3846154 ± 137910'     │ 3642339 │
│ 5       │ 'awilix''260.22 ± 0.21%''241.00 ± 9.00''3989918 ± 0.01%''4149378 ± 149378'     │ 3842939 │
│ 6       │ 'NestJS''328.31 ± 0.14%''311.00 ± 10.00''3143810 ± 0.01%''3215434 ± 106825'     │ 3045941 │
│ 7       │ 'tsyringe''320.20 ± 0.28%''301.00 ± 10.00''3251767 ± 0.01%''3322259 ± 114167'     │ 3123038 │
└─────────┴──────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 0.994x
inversifyCurrent vs inversify6 Speedup: 4.126x
inversifyCurrent vs inversify7 Speedup: 1.168x
inversifyCurrent vs inversify8 Speedup: 1.026x
inversifyCurrent vs awilix Speedup: 0.968x
inversifyCurrent vs NestJS Speedup: 1.229x
inversifyCurrent vs tsyringe Speedup: 1.188x

Get complex service in transient scope
┌─────────┬───────────────────────────────────────────────┬───────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                                     │ Latency avg (ns)  │ Latency med (ns)  │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼───────────────────────────────────────────────┼───────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''70123 ± 0.60%''66836 ± 3025.0''14605 ± 0.17%''14962 ± 685'          │ 14261   │
│ 1       │ 'inversifyCurrent (Jitless)''129281 ± 0.39%''126588 ± 2885.0''7822 ± 0.18%''7900 ± 183'           │ 7736    │
│ 2       │ 'inversifyCurrent (Resolved Value)''66717 ± 0.58%''63780 ± 511.00''15310 ± 0.14%''15679 ± 127'          │ 14989   │
│ 3       │ 'inversifyCurrent (Jitless) (Resolved Value)''69021 ± 0.58%''65634 ± 941.00''14790 ± 0.15%''15236 ± 220'          │ 14489   │
│ 4       │ 'inversify6''5390370 ± 2.71%''5078306 ± 36338''189 ± 1.53%''197 ± 1'              │ 186     │
│ 5       │ 'inversify7''299264 ± 0.79%''289244 ± 1974.0''3394 ± 0.26%''3457 ± 24'            │ 3342    │
│ 6       │ 'inversify8''112469 ± 0.40%''110237 ± 3246.0''8995 ± 0.15%''9071 ± 266'           │ 8892    │
│ 7       │ 'awilix''290125 ± 0.30%''283863 ± 2584.0''3463 ± 0.18%''3523 ± 32'            │ 3447    │
│ 8       │ 'NestJS''79501 ± 1.54%''71444 ± 1413.0''13377 ± 0.22%''13997 ± 280'          │ 12579   │
│ 9       │ 'tsyringe''213245 ± 0.43%''207300 ± 1674.0''4734 ± 0.19%''4824 ± 39'            │ 4690    │
└─────────┴───────────────────────────────────────────────┴───────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.867x
inversifyCurrent vs inversifyCurrent (Resolved Value) Speedup: 0.954x
inversifyCurrent vs inversifyCurrent (Jitless) (Resolved Value) Speedup: 0.988x
inversifyCurrent vs inversify6 Speedup: 77.246x
inversifyCurrent vs inversify7 Speedup: 4.303x
inversifyCurrent vs inversify8 Speedup: 1.624x
inversifyCurrent vs awilix Speedup: 4.218x
inversifyCurrent vs NestJS Speedup: 1.092x
inversifyCurrent vs tsyringe Speedup: 3.085x

Get complex service with properties in transient scope
┌─────────┬──────────────────────────────┬───────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns)  │ Latency med (ns)  │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼───────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''81179 ± 0.71%''76454 ± 651.00''12679 ± 0.19%''13080 ± 111'          │ 12319   │
│ 1       │ 'inversifyCurrent (Jitless)''174730 ± 0.60%''172584 ± 3551.0''5809 ± 0.22%''5794 ± 121'           │ 5724    │
│ 2       │ 'inversify6''5704369 ± 2.62%''5387362 ± 32035''178 ± 1.57%''186 ± 1'              │ 176     │
│ 3       │ 'inversify7''345216 ± 0.88%''335761 ± 2905.0''2934 ± 0.24%''2978 ± 26'            │ 2897    │
│ 4       │ 'inversify8''213107 ± 0.66%''205766 ± 5431.0''4769 ± 0.24%''4860 ± 126'           │ 4693    │
│ 5       │ 'NestJS''321526 ± 1.89%''285056 ± 7234.0''3330 ± 0.53%''3508 ± 91'            │ 3111    │
└─────────┴──────────────────────────────┴───────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 2.183x
inversifyCurrent vs inversify6 Speedup: 71.031x
inversifyCurrent vs inversify7 Speedup: 4.321x
inversifyCurrent vs inversify8 Speedup: 2.659x
inversifyCurrent vs NestJS Speedup: 3.808x

Get complex async service in transient scope
┌─────────┬──────────────────────────────┬───────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns)  │ Latency med (ns)  │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼───────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''368593 ± 0.88%''353704 ± 7183.5''2768 ± 0.37%''2827 ± 57'            │ 2714    │
│ 1       │ 'inversifyCurrent (Jitless)''405148 ± 0.84%''392067 ± 6783.0''2514 ± 0.35%''2551 ± 44'            │ 2469    │
│ 2       │ 'inversify6''5087417 ± 2.77%''4738458 ± 55956''201 ± 1.68%''211 ± 3'              │ 197     │
│ 3       │ 'inversify7''707332 ± 0.89%''687102 ± 5335.5''1432 ± 0.43%''1455 ± 11'            │ 1414    │
│ 4       │ 'inversify8''400555 ± 0.85%''386076 ± 6742.0''2546 ± 0.37%''2590 ± 45'            │ 2497    │
└─────────┴──────────────────────────────┴───────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.101x
inversifyCurrent vs inversify6 Speedup: 13.767x
inversifyCurrent vs inversify7 Speedup: 1.933x
inversifyCurrent vs inversify8 Speedup: 1.087x
[ESM] Running benchmarks...

Get service in singleton scope
┌─────────┬──────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''248.21 ± 0.30%''231.00 ± 1.00''4169203 ± 0.01%''4329004 ± 18822'      │ 4028770 │
│ 1       │ 'inversifyCurrent (Jitless)''241.73 ± 0.15%''230.00 ± 10.00''4292284 ± 0.01%''4347826 ± 197628'     │ 4136773 │
│ 2       │ 'inversify6''944.42 ± 0.26%''871.00 ± 19.00''1114760 ± 0.02%''1148106 ± 25603'      │ 1058856 │
│ 3       │ 'inversify7''290.34 ± 0.15%''271.00 ± 10.00''3562248 ± 0.01%''3690037 ± 131318'     │ 3444181 │
│ 4       │ 'inversify8''251.89 ± 0.10%''240.00 ± 9.00''4106781 ± 0.01%''4166667 ± 162338'     │ 3970035 │
│ 5       │ 'awilix''238.80 ± 0.23%''221.00 ± 10.00''4389248 ± 0.01%''4524887 ± 214450'     │ 4187566 │
│ 6       │ 'NestJS''321.68 ± 0.33%''300.00 ± 10.00''3288824 ± 0.01%''3333333 ± 114943'     │ 3108671 │
│ 7       │ 'tsyringe''306.95 ± 0.31%''281.00 ± 10.00''3416726 ± 0.01%''3558719 ± 122293'     │ 3257824 │
└─────────┴──────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 0.971x
inversifyCurrent vs inversify6 Speedup: 3.740x
inversifyCurrent vs inversify7 Speedup: 1.170x
inversifyCurrent vs inversify8 Speedup: 1.015x
inversifyCurrent vs awilix Speedup: 0.950x
inversifyCurrent vs NestJS Speedup: 1.268x
inversifyCurrent vs tsyringe Speedup: 1.220x

Get service in transient scope
┌─────────┬──────────────────────────────┬──────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns) │ Latency med (ns)  │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼──────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''301.60 ± 0.24%''280.00 ± 10.00''3492204 ± 0.01%''3571429 ± 132275'     │ 3315645 │
│ 1       │ 'inversifyCurrent (Jitless)''320.19 ± 0.20%''301.00 ± 10.00''3236474 ± 0.01%''3322259 ± 106825'     │ 3123183 │
│ 2       │ 'inversify6''5470.4 ± 0.24%''5040.0 ± 91.00''191308 ± 0.06%''198413 ± 3648'        │ 182801  │
│ 3       │ 'inversify7''519.36 ± 0.25%''491.00 ± 10.00''1998473 ± 0.01%''2036660 ± 42342'      │ 1925439 │
│ 4       │ 'inversify8''292.90 ± 0.22%''271.00 ± 9.00''3549927 ± 0.01%''3690037 ± 118608'     │ 3414123 │
│ 5       │ 'awilix''456.50 ± 0.31%''431.00 ± 10.00''2275557 ± 0.01%''2320186 ± 55111'      │ 2190578 │
│ 6       │ 'NestJS''10811 ± 2.05%''9187.0 ± 250.00''103560 ± 0.10%''108849 ± 2920'        │ 92495   │
│ 7       │ 'tsyringe''439.66 ± 0.13%''411.00 ± 11.00''2358355 ± 0.01%''2433090 ± 66910'      │ 2274487 │
└─────────┴──────────────────────────────┴──────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.079x
inversifyCurrent vs inversify6 Speedup: 18.254x
inversifyCurrent vs inversify7 Speedup: 1.747x
inversifyCurrent vs inversify8 Speedup: 0.984x
inversifyCurrent vs awilix Speedup: 1.535x
inversifyCurrent vs NestJS Speedup: 33.722x
inversifyCurrent vs tsyringe Speedup: 1.481x

Get wide service in transient scope
┌─────────┬──────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''581.59 ± 0.32%''551.00 ± 10.00''1785724 ± 0.01%''1814882 ± 33547'      │ 1719425 │
│ 1       │ 'inversifyCurrent (Jitless)''970.55 ± 0.22%''932.00 ± 10.00''1058472 ± 0.01%''1072961 ± 11637'      │ 1030339 │
│ 2       │ 'inversify6''24538 ± 0.33%''23063 ± 211.00''42022 ± 0.11%''43359 ± 400'          │ 40754   │
│ 3       │ 'inversify7''1262.0 ± 0.28%''1193.0 ± 11.00''821329 ± 0.02%''838223 ± 7801'        │ 792374  │
│ 4       │ 'inversify8''762.85 ± 0.21%''731.00 ± 10.00''1350855 ± 0.01%''1367989 ± 18973'      │ 1310876 │
│ 5       │ 'awilix''1240.8 ± 0.15%''1202.0 ± 20.00''820600 ± 0.01%''831947 ± 13616'       │ 805932  │
│ 6       │ 'NestJS''24522 ± 1.33%''21881 ± 451.00''43771 ± 0.13%''45702 ± 943'          │ 40780   │
│ 7       │ 'tsyringe''1315.8 ± 0.15%''1262.0 ± 19.00''780491 ± 0.02%''792393 ± 12112'       │ 759988  │
└─────────┴──────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.687x
inversifyCurrent vs inversify6 Speedup: 42.495x
inversifyCurrent vs inversify7 Speedup: 2.174x
inversifyCurrent vs inversify8 Speedup: 1.322x
inversifyCurrent vs awilix Speedup: 2.176x
inversifyCurrent vs NestJS Speedup: 40.797x
inversifyCurrent vs tsyringe Speedup: 2.288x

Get complex service in singleton scope
┌─────────┬──────────────────────────────┬──────────────────┬──────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns) │ Latency med (ns) │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼──────────────────┼──────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''273.64 ± 0.25%''260.00 ± 9.00''3769396 ± 0.01%''3846154 ± 137910'     │ 3654373 │
│ 1       │ 'inversifyCurrent (Jitless)''272.36 ± 0.13%''260.00 ± 9.00''3782095 ± 0.01%''3846154 ± 137910'     │ 3671635 │
│ 2       │ 'inversify6''927.72 ± 2.13%''852.00 ± 11.00''1137182 ± 0.02%''1173709 ± 15352'      │ 1077907 │
│ 3       │ 'inversify7''289.52 ± 0.13%''271.00 ± 10.00''3581239 ± 0.01%''3690037 ± 131318'     │ 3453995 │
│ 4       │ 'inversify8''251.95 ± 0.16%''240.00 ± 9.00''4103275 ± 0.01%''4166667 ± 162338'     │ 3968964 │
│ 5       │ 'awilix''251.12 ± 0.12%''240.00 ± 10.00''4110692 ± 0.01%''4166667 ± 166667'     │ 3982165 │
│ 6       │ 'NestJS''328.11 ± 0.26%''311.00 ± 10.00''3139895 ± 0.01%''3215434 ± 100169'     │ 3047732 │
│ 7       │ 'tsyringe''301.14 ± 0.31%''281.00 ± 10.00''3480437 ± 0.01%''3558719 ± 131318'     │ 3320745 │
└─────────┴──────────────────────────────┴──────────────────┴──────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 0.997x
inversifyCurrent vs inversify6 Speedup: 3.315x
inversifyCurrent vs inversify7 Speedup: 1.053x
inversifyCurrent vs inversify8 Speedup: 0.919x
inversifyCurrent vs awilix Speedup: 0.917x
inversifyCurrent vs NestJS Speedup: 1.200x
inversifyCurrent vs tsyringe Speedup: 1.083x

Get complex service in transient scope
┌─────────┬───────────────────────────────────────────────┬───────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                                     │ Latency avg (ns)  │ Latency med (ns)  │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼───────────────────────────────────────────────┼───────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''67856 ± 0.59%''64912 ± 772.00''15045 ± 0.14%''15405 ± 183'          │ 14738   │
│ 1       │ 'inversifyCurrent (Jitless)''125172 ± 0.43%''121393 ± 2675.0''8088 ± 0.17%''8238 ± 179'           │ 7990    │
│ 2       │ 'inversifyCurrent (Resolved Value)''66978 ± 0.59%''64211 ± 581.00''15248 ± 0.13%''15574 ± 142'          │ 14931   │
│ 3       │ 'inversifyCurrent (Jitless) (Resolved Value)''68671 ± 0.60%''64852 ± 1052.0''14892 ± 0.15%''15420 ± 252'          │ 14563   │
│ 4       │ 'inversify6''5060454 ± 3.21%''4731313 ± 37104''203 ± 1.60%''211 ± 2'              │ 198     │
│ 5       │ 'inversify7''223631 ± 0.57%''213882 ± 1483.0''4546 ± 0.27%''4675 ± 33'            │ 4472    │
│ 6       │ 'inversify8''107668 ± 0.39%''104847 ± 851.00''9394 ± 0.14%''9538 ± 78'            │ 9288    │
│ 7       │ 'awilix''260587 ± 0.36%''254688 ± 2199.0''3862 ± 0.19%''3926 ± 34'            │ 3838    │
│ 8       │ 'NestJS''81755 ± 1.66%''72526 ± 1432.0''13132 ± 0.24%''13788 ± 274'          │ 12232   │
│ 9       │ 'tsyringe''214182 ± 0.40%''209334 ± 2115.0''4707 ± 0.18%''4777 ± 48'            │ 4669    │
└─────────┴───────────────────────────────────────────────┴───────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.860x
inversifyCurrent vs inversifyCurrent (Resolved Value) Speedup: 0.987x
inversifyCurrent vs inversifyCurrent (Jitless) (Resolved Value) Speedup: 1.010x
inversifyCurrent vs inversify6 Speedup: 74.281x
inversifyCurrent vs inversify7 Speedup: 3.310x
inversifyCurrent vs inversify8 Speedup: 1.601x
inversifyCurrent vs awilix Speedup: 3.895x
inversifyCurrent vs NestJS Speedup: 1.146x
inversifyCurrent vs tsyringe Speedup: 3.196x

Get complex service with properties in transient scope
┌─────────┬──────────────────────────────┬───────────────────┬───────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns)  │ Latency med (ns)  │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼───────────────────┼───────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''77337 ± 0.72%''72897 ± 621.00''13298 ± 0.17%''13718 ± 118'          │ 12931   │
│ 1       │ 'inversifyCurrent (Jitless)''151761 ± 0.60%''147367 ± 811.00''6684 ± 0.17%''6786 ± 37'            │ 6590    │
│ 2       │ 'inversify6''5422569 ± 3.22%''5050363 ± 76543''189 ± 1.75%''198 ± 3'              │ 185     │
│ 3       │ 'inversify7''258936 ± 0.63%''250861 ± 1232.0''3911 ± 0.23%''3986 ± 20'            │ 3862    │
│ 4       │ 'inversify8''211412 ± 0.72%''206778 ± 1382.0''4813 ± 0.24%''4836 ± 32'            │ 4731    │
│ 5       │ 'NestJS''339988 ± 2.13%''294038 ± 9157.0''3199 ± 0.62%''3401 ± 107'           │ 2942    │
└─────────┴──────────────────────────────┴───────────────────┴───────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.989x
inversifyCurrent vs inversify6 Speedup: 70.289x
inversifyCurrent vs inversify7 Speedup: 3.401x
inversifyCurrent vs inversify8 Speedup: 2.763x
inversifyCurrent vs NestJS Speedup: 4.157x

Get complex async service in transient scope
┌─────────┬──────────────────────────────┬───────────────────┬────────────────────┬────────────────────────┬────────────────────────┬─────────┐
│ (index) │ Task name                    │ Latency avg (ns)  │ Latency med (ns)   │ Throughput avg (ops/s) │ Throughput med (ops/s) │ Samples │
├─────────┼──────────────────────────────┼───────────────────┼────────────────────┼────────────────────────┼────────────────────────┼─────────┤
│ 0       │ 'inversifyCurrent''356266 ± 0.86%''342584 ± 7063.0''2862 ± 0.35%''2919 ± 61'            │ 2807    │
│ 1       │ 'inversifyCurrent (Jitless)''396171 ± 0.82%''382479 ± 6592.0''2571 ± 0.35%''2615 ± 45'            │ 2525    │
│ 2       │ 'inversify6''4842570 ± 3.02%''4489318 ± 123853''212 ± 1.71%''223 ± 6'              │ 207     │
│ 3       │ 'inversify7''633987 ± 0.90%''615446 ± 6528.0''1599 ± 0.41%''1625 ± 17'            │ 1578    │
│ 4       │ 'inversify8''376680 ± 0.86%''361790 ± 6352.0''2711 ± 0.37%''2764 ± 49'            │ 2655    │
└─────────┴──────────────────────────────┴───────────────────┴────────────────────┴────────────────────────┴────────────────────────┴─────────┘
inversifyCurrent vs inversifyCurrent (Jitless) Speedup: 1.113x
inversifyCurrent vs inversify6 Speedup: 13.509x
inversifyCurrent vs inversify7 Speedup: 1.790x
inversifyCurrent vs inversify8 Speedup: 1.056x

@notaphplover
notaphplover merged commit 161c5c5 into main Jul 16, 2026
11 checks passed
@notaphplover
notaphplover deleted the refactor/move-get-activations-to-resolution-context branch July 16, 2026 17:23
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.

1 participant