Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's still hard, given the tiny benefit it would give to 99% of code.

Maybe modern tooling (e.g. Cargo) will lower the barrier so that it becomes less rare, but in C++ it's definitely not worth the effort for the vast vast vast majority of projects.



Wow, I find "vast vast vast" hard to believe. If we don't have loops where a lot of CPU time is spent, why even write in C++?

I admittedly focus more on libraries, but quite a large number of them are already vectorized. I would venture that a sizable fraction of CPU time, even in 'normal' non-HPC context, uses SIMD indirectly. Think image/video decompression, browser handshakes/rendering, image editing, etc.


> If we don't have loops where a lot of CPU time is spent, why even write in C++?

Because it isn't just hot or autovectorisable loops that are faster in C++; everything is faster. Function calls, member accesses, arithmetic, etc. Even loops are normally not very hot and not autovectorisable.

You're right that things like audio/image processing, compression etc. benefits from SIMD but that is in the 1%. Those are libraries that have already been written. The vast vast majority of people are not writing audio codecs or whatever.


> Those are libraries that have already been written.

Written using SIMD.

> The vast vast majority of people are not writing audio codecs or whatever.

Or HPC, or finance, or json parsing, or PDE solving, or gaming....

All off these (and more) benefit from AVX512. Why are you going so far out of your way to be dismissive of this?


Unfortunately Rust is way behind on getting SIMD intrinsics out there. Anything AVX512 is nightly (unstable) only still.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: