Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/introduction/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ across-run dispersion of each side's own median.
Rival versions: dishka 1.10.1, dependency-injector 4.49.1, that-depends 4.0.2, wireup 2.12.0.
Generated by `just bench-report`.

> **These numbers are a snapshot of the version named above; a newer release does not update
> them.** The tables are regenerated by hand, so they lag a release rather than ship with one. If
> you are running a later modern-di, nothing below has been re-measured against it: run
> `just bench-report` yourself (see [Reproduce it yourself](#reproduce-it-yourself)) to measure
> the version you have.

Each cell is modern-di ÷ rival: below 1.0 (bold) means modern-di is faster,
above 1.0 means slower. Every ratio is **paired within each run** — one run measures both sides
under the same machine state, so the published statistic is the median of the per-run ratios,
Expand Down Expand Up @@ -125,16 +131,16 @@ _Across-run IQR of each side's own median (5 runs): modern-di ≤1.9%, rivals
that-depends, whose implied C2 absolute is unchanged at ~83 ns. that-depends remains faster
on C2 warm-singleton (1.90); the suite does not decompose its `resolve_sync` cache-hit path,
so no mechanism is asserted for the remaining gap.
- **Against the two `exec`-codegen frameworks, the by-type table has crossed over.** modern-di
is now faster than `dishka` on C1 (**0.91**) and C2 (**0.81**), and faster than `wireup` on
- **Against the two `exec`-codegen frameworks, the by-type table has crossed over.** At 3.3.0
modern-di is faster than `dishka` on C1 (**0.91**) and C2 (**0.81**), and faster than `wireup` on
C3 (**0.90**) while level on C1 (1.01). One publication earlier it was slower than both on
every one of these cells. dishka keeps a clear lead on C3 (1.30), the deepest graph, which is
consistent with the per-node call frame that `exec`-inlined source removes and modern-di
keeps — the mechanism this page has always asserted for dishka, and the one cell where it
still dominates. modern-di does not generate code (a
[documented non-goal](design-decisions.md#non-goals)); the gap closed by removing frames from
the interpreted path instead.
- **The by-type surcharge is now small enough to stop mattering.** Dividing modern-di's
- **At 3.3.0 the by-type surcharge is small enough to stop mattering.** Dividing modern-di's
by-reference cells by its by-type ones gives a fixed cost of 21/17/23 ns on C1/C2/C3, against
54-65 ns one publication earlier. `Container.resolve` no longer delegates to
`resolve_provider` — it carries that body itself — so what remains is close to the bare
Expand Down
Loading