Skip to content

Faster container resolution

Latest

Choose a tag to compare

@github-actions github-actions released this 28 Oct 12:26
Immutable release. Only release title and notes can be modified.

Faster resolution of classes without dependencies

Classes with no dependencies are now constructed directly, skipping the resolution pipeline. Benchmarks show container.make running about 3x faster on them. resolver.call gets the same shortcut for methods without dependencies.

A class takes the shortcut only when nothing could change the result:

  • it has no containerProvider and no @inject metadata,
  • enough runtime values were passed for every constructor or method parameter,
  • it has no binding, swap or hook registered in the container.

Otherwise it goes through the regular pipeline as before. Observable behavior is unchanged: errors still reject the returned promise, resolved events are still emitted, and diagnostics_channel subscribers receive the same tracing events. Also, make is now traced only when the channel has subscribers, and isClass results are cached per constructor.

Bug fixes

  • Classes that define a static toString method are now correctly detected as classes by the container (#75)

Commits

  • perf(container): resolve classes without dependencies 3x faster (#74)
  • fix(container): detect classes that define a static toString method (#75)
  • chore: harden release workflow for supply-chain security (#69)
  • chore(deps): bump actions/stale from 9 to 11 (#71)