Flattened structs on 64-byte cache lines: the simple principle of high-performance code
ryunuck · x · 2026-10-14
- @rygo6: high-performance code is simple in principle — one big contiguous array of compact structs (≤64-byte cache line, no pointers, flattened data), so each L1 load brings the whole element; then a simple for loop lets CPU prediction recognize the pattern and prefetch ahead (L1 reads up to 100x faster than RAM).
- ryunuck adds a caveat: this only applies if your program "completes" with an output like "Completed in N seconds". If the requirement is "180 fps", the optimization surface is the frame itself — push/pop address-space.
More from coding & agent
- Surge launches sudo L7, a benchmark measuring staff-level engineering judgment in real codebases — echen · 2026-10-14
- Dev complains Cloudflare is 'hostile to AI' blocking her agent, asks for alternatives — mimi10v3 · 2026-10-14
- Copilot keeps hitting company guardrails on tasks its chat mode handles fine — annetgriffin · 2026-10-14
- Omarchy Linux now runs on Android phones with fingerprint unlock on Pixel 7 Pro — mark_k · 2026-10-14
- Devs say context compaction is good enough now — drop the window anxiety — brandon_galang · 2026-10-14
- Agent token spend hits 1-2x payroll as coding agents rewrite engineering norms — nlarusstone · 2026-10-14