Boids sim hits 50K agents at 50FPS after a simple cache-friendly index sort

neuroecology · x · 2026-09-16

A developer improved the frame rate of their browser-based boids simulator by periodically sorting neighbor indices, fixing poor cache locality from scattered memory access. The result: 50,000 agents running at around 50FPS. A neat reminder that simulation performance is often about memory access patterns, not the algorithm itself.

Original post →

More from Fun

Fun channel →