You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
run_command sits at an inlining edge: unrelated changes move 10-15 instructions per GET #867
Seen twice on 2026-11-17, on two unrelated PRs (#864, #866) that each added a few lines to run_command away from the read path: per GET on io_uring, about 13 instructions leave execute_command (slice compare) and 13-14 appear in Option<Vec<u8>>::or_else::<run_command::{closure}> (the dispatch_command_handlers(ctx, name).or_else(|| lua::handle(ctx, name)) chain near the end of run_command), with a net of +10 to +12 instructions per GET and +5 per SET. #845 hit the same kind of thing harder (+50 per GET from a closure that stopped being inlined).
run_command is large enough that the compiler's inlining choices inside it flip with small changes, so every PR that touches it has to be measured, and some pay a cost that is not theirs.
To do:
find which call flips (per-function callgrind diff of master against a build with a no-op line added to run_command), and pin it: #[inline(always)] / #[cold] where the intent is known, or split the cold parts of run_command (cluster routing, replica checks, keyspace-event watch, error accounting) into #[cold] #[inline(never)] functions so the hot path is small and stable;
measure GET/SET at 100 B and 1 KB on both I/O models before and after (scripts/perf/run.sh); the goal is the same or fewer instructions than today and no movement when a line is added elsewhere in the function;
add the "no-op line" stability check to the notes in scripts/perf.
Default variant and lua both (the closure only exists with lua; check what the default build does at the same place).
Activity