Live data from Hacker News

Everyone should know SIMD

mitchellh.com

261–263 of 263 posts

Re: Everyone should know SIMD

#262

The vast majority of developers have 0 need for learning SIMD. Why mislead them, and make them feel like to be a "real" developer they have to know it?

The parent comment is now YouTube famous, and apparently represents the entire Hacker News zeitgeist. Reading replies to this article, it seems... like a slight exaggeration?

https://www.youtube.com/watch?v=4nJ2tEPD4-k&t=48s

Re: Everyone should know SIMD

#263

I'd slightly rephrase the title to "everyone should know when SIMD didn't happen." Modern compliers are extremely good at vectorization until they suddenly aren't, an they'll often fall back to scalar code because if assumptions or a single-data dependent branch. Learning to check the compliers optimization reports is arguably more valuable.

> Learning to check the compliers optimization reports is arguably more valuable Where do I start? I want to trust the compiler, but I don't always have time to feed every little piece into compiler explorer and interpret it. Is there a higher-level workflow?

In addition to godbolt and reading the output, the scalable check is just benchmarks. When you write new code that you want to autovectorize, you can check it in ways mentioned already. But then IMO the biggest downside of autovectorization is that it can suddenly disappear with seemingly minor code changes. For that you want benchmarks that run in CI or on some regular schedule. Then when you see a regression you can use a profiler plus the other mentioned tools to investigate
Post reply on HN