Go 1.27 SIMD Matches NumPy Out of Cache but Loses When Data Fits In It
Go 1.27 introduced an experimental SIMD package in its standard library, prompting a developer to benchmark it against NumPy on a speaker-search task involving 346,000 vectors and 66 million multiplications per query. When the 253 MB dataset exceeded all cache levels, Go SIMD and NumPy returned nearly identical results at around 9.5–9.8 ms, a statistical tie. However, with a smaller 31 MB dataset that fit in L3 cache, NumPy's OpenBLAS backend was 2.4 times faster, reflecting years of hand-tuned, architecture-specific optimisation. Parallelising across eight cores yielded only a 3x speedup in both languages, revealing that memory bandwidth — not code quality — was the true bottleneck in the larger test. The key finding is that cache residency, not the choice of language or library, determines which implementation wins.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in