Redis: Shaving Branch Misses Out of SipHash
A single targeted change to Redis's SipHash implementation replaces an unpredictable branch with an overlapping memory load, addressing a measured performance cost in real-world workloads.
Duration: PT2M6S
Episode overview
This episode is a short developer briefing from Redis.
It explains recent repository work in plain language.
- Show: Redis
- Published: 2026-09-11T13:14:00Z
- Audio duration: PT2M6S
Transcript excerpt
This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.
Good morning. It's September 11th, 2026, and this is your Redis briefing.
Today's activity is narrow but the reasoning behind it is worth understanding, because it's a good example of low-level performance engineering paying off in a workload that matters.
PR 15777, from contributor abokhalill, targets the hash key function that Redis uses internally: SipHash. The specific problem is how the function handles the leftover bytes at the end of a key, the last one to seven bytes that don't fill a full block. The existing code used a switch statement, which the compiler…
The author backed this up with numbers. On an i9-9900K running memtier with a nine-to-one GET-to-SET ratio over a 200,000 key space, SipHash alone was responsible for nearly 8 percent of all branch misses in the run. That's a meaningful chunk of wasted CPU cycles for a function that gets called on essentially every…
The fix replaces the switch with an overlapping load, a technique that reads the tail bytes without branching on their exact count. It's a small, self-contained change, but it's the kind of fix that compounds: SipHash sits on the hot path for key lookups, so fewer branch misses there translates to steadier…
Ther…
Nearby episodes from Redis
- Correctness Fixes in Replication and Diagnostics
- Correctness Fixes and Core Refactors Converge
- Correctness Fixes Meet CPU-Level Performance Tuning
- Quiet Bugs in Loud Places
- Weekly Recap - Correctness Fixes and Test Stability
- A Cluster Security Fix and Two Correctness Patches
- HELLO Gets a Server ID
- List Move Notification Fix