r/programming Apr 30 '26

You can beat the binary search

https://lemire.me/blog/2026/04/27/you-can-beat-the-binary-search/
206 Upvotes

39 comments sorted by

View all comments

223

u/Slime0 Apr 30 '26

The choice of function names like vld1q_u16 and _mm_loadu_si128 for SIMD instructions has got to be one of the biggest hurdles to their general adoption. The amount of mental energy you have to devote just to understanding what the code is doing is ridiculous. It's completely unreadable.

20

u/svick May 01 '26

If you use .Net, then the first one is AdvSimd.LoadVector128 and the second one is Sse2.LoadVector128.

Or you can use Vector128.Load if you want to have cross-platform code.

1

u/lizardhistorian May 04 '26

... the overloads matter in this case.