Performance

Fast resolves for small explicit service graphs.

Injex 1.3.0 caches dependency plans and uses a fast path for common constructor-injection graphs: singleton infrastructure plus transient application services.

Benchmark shape

The benchmark repeatedly resolves this graph:

Local result

LibraryMedian resolve time
manual wiring0.265 µs/op
Injex0.818 µs/op
Wireup, same scope0.879 µs/op
Wireup, scope per operation1.559 µs/op
dependency-injector1.727 µs/op
lagom9.794 µs/op
punq56.795 µs/op

Benchmarks are synthetic and not a universal ranking. They show the approximate overhead of Injex in its target shape: small explicit graphs reused by APIs, workers, CLIs, and tests.

Reproduce

uv run --with punq --with lagom --with dependency-injector --with wireup \
  python benchmarks/resolve_graph.py