zlacker

[return to "From slow to SIMD: A Go optimization story"]
1. koala_+1o[view] [source] 2024-01-23 19:31:46
>>rbanff+(OP)
TIL that the Go compiler still does not have autovectorization.
◧◩
2. neonsu+IK[view] [source] 2024-01-23 21:08:29
>>koala_+1o
Even manual vectorization is pain...writing ASM, really?

Rust has unstable portable SIMD and a few third-party crates, C++ has that as well, C# has stable portable SIMD and a small out of box BLAS-like library to help with most common tasks (like SoftMax, Magnitude and etc. on top of spans of floats over writing manually), hell it even exercises PackedSIMD when ran in a browser. And now Java is getting Panama vectors some time in the future (though the question of codegen quality stands open given planned changes to unsafe API).

Go among these is uniquely disadvantaged. And if that's not enough, you may want to visit 1Brc's challenge discussions and see that Go struggles to get anywhere close to 2s mark with both C# and C++ blazing past it:

https://hotforknowledge.com/2024/01/13/1brc-in-dotnet-among-...

https://github.com/gunnarmorling/1brc/discussions/67

◧◩◪
3. Thaxll+Dn1[view] [source] 2024-01-24 01:01:51
>>neonsu+IK
5sec for simple and readable code: https://gist.github.com/corlinp/176a97c58099bca36bcd5679e68f...

Have you seen the 2sec code from c#?

[go to top]