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:
- singleton
Settingsinstance; - singleton
ApiClient(settings); - transient repository, email sender, and audit log;
- transient
RegisterUser(repository, email_sender, audit_log).
Local result
| Library | Median resolve time |
|---|---|
| manual wiring | 0.266 µs/op |
| Injex | 0.333 µs/op |
| dishka | 0.786 µs/op |
| Wireup, same scope | 0.872 µs/op |
| Wireup, scope per operation | 1.544 µs/op |
| dependency-injector | 1.709 µs/op |
| lagom | 9.487 µs/op |
| punq | 56.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