Urgent.News

What's breaking now, across thousands of outlets.

Editions

Tech

Go 1.27's SIMD ties with NumPy until the data fits in cache

Go 1.27 shipped a simd package in the standard library. It is experimental and sits behind a flag, and every write-up I found described the API. None of them said when it actually helps. So I measured it against NumPy on the same task: a speaker-search index, 346 thousand vectors of 192 dimensions, 66 million multiplications per query. The answer turned out not to be about Go or NumPy at all.…

Go 1.27 introduced a new SIMD package in its standard library, but its performance benefits depend on whether the data fits in the cache. The package was measured against NumPy on the same task: a speaker-search index with 346,000 vectors of 192 dimensions, resulting in 66 million multiplications per query. When the 253 MB corpus exceeded cache capacity, both Go SIMD and NumPy spent most of their time waiting for memory, leading to similar performance.

However, when the 31 MB corpus fit in the L3 cache, NumPy outperformed Go SIMD by a factor of 2.4. The key factor determining speed is whether the data fits in cache, not the programming language itself. A significant change in the measurement process revealed the true disparity between the two implementations, emphasizing the importance of controlling for factors like CPU load and measurement precision.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

More from Thursday 20 August →