optimize binary search via L1 dcache prefetching using `__builtin_prefetch`
christianparpart opened this issue · 3 comments
libunicode/src/unicode/ucd_private.h
Lines 30 to 47 in a0f7291
From my collection 😄
https://github.com/scandum/binary_search
https://github.com/ehrmann/branchless-binary-search
https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/extra/binsearch.c
https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/tree/master/extra/search
But I'm guessing that case ranges in switch statement can be faster.
gcc & clang supports it, not sure for MSVC.
I currently have a naive O(log2) implementation. I had a look at some of your proposals and it seems they all cover interesting points. I would love to have a solution that improves table lookup performance.
Can be closed because the new codepoint_properties API (#46) comes with O(1) lookup. The existing API implementations still using binary-search tables will either be removed (other ticket) or rewritten to use the new API.