Re:Optimizations on Linear Search (2016)
by hhmc on Saturday October 03, 2020 @11:43AM
(#24672751)
It’s also strange to advocate for using a stdlib provided sort. It’s hard to imagine a stdlib worth it’s salt that provides ‘sort’ but not some kind of ‘linear search’ (and the stdlib implementation would likely use SIMD).
[ Parent
| on HN ]
Re:Optimizations on Linear Search (2016)
by Joker_vD on Saturday October 03, 2020 @11:59AM
(#24672850)
Well, Go's standard library has no linear search routine. But it does have both sort and binary search.
Re:Optimizations on Linear Search (2016)
by gameswithgo on Saturday October 03, 2020 @12:21PM
(#24673000)
standard libraries are only just now starting to use SIMD at all. .NET has been working hard on SIMDifying their core libraries lately. Do any C++ implementations of the std do so? Or do they just lean on llvm/gcc to autovectorize when possible?
Re:Optimizations on Linear Search (2016)
by formerly_proven on Saturday October 03, 2020 @12:26PM
(#24673024)
There's really no point providing a hand-rolled SIMD implementation for stuff like std::max_element. It's a very trivial loop that any compiler can and will vectorize.
Auto-vectorization in general "just works" for basic stuff. It's only the complex stuff where you can really benefit from hand-rolled SIMD implementations; you'll know it when you see it.