News for hackers. Stuff that matters.
Re:“Clean” Code, Horrible Performance by rerdavies on Tuesday February 28, 2023 @10:05PM (#34978271)
You need to do some research on how to get modern C/C++ compilers to vectorize.;-) No assembly required, and not that hard to restructure code. (But MUCH easier in C++).
Re:“Clean” Code, Horrible Performance by anonymoushn on Tuesday February 28, 2023 @11:16PM (#34978692)
So far it seems like if you have some parsing or formatting task that can be trivially vectorized, the compiler will never do that, and you absolutely must use intrinsics.
Re:“Clean” Code, Horrible Performance by loup-vaillant on Wednesday March 01, 2023 @02:58AM (#34979856)
I tried auto-vectorisation, and it worked pretty well. But the code became just as big as using intrinsics would have (that with explicitly unrolling loops and rearranging things in memory), and intrinsics generated code that was easily 35% faster.

I decided not put it off for later, and keep things simple for now.