Performance

Fast resolves for small explicit service graphs.

Injex 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.266 µs/op
Injex0.333 µs/op
dishka0.786 µs/op
Wireup, same scope0.872 µs/op
Wireup, scope per operation1.544 µs/op
dependency-injector1.709 µs/op
lagom9.487 µs/op
punq56.982 µ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 --with dishka \
  python benchmarks/resolve_graph.py