Faster search thanks to branchless algorithms and inliniling #315
Replies: 1 comment
|
In some non-local chats, discussions were noticed, with a slightly incorrect interpretation.
If you've finished reading and understood something, then your IQ is underestimated ;) |
Uh oh!
There was an error while loading. Please reload this page.
Since 3412f1b, libmdbx uses fast indirect dispatch (indirect calls) for search on a pages functions. This made it possible both to inline all the built-in comparators and reasonable to use a branchless binary search implementation.
The basic branchless-search implementation looks very simple, but try to improve something without making it worse for other compilers ;)
This code works well enough most on all architectures when compiled by three most popular compilers (gcc, clang msvc).
So now the search and most related operations in the database will be faster. When working with integer keys using built-in comparators, you can expect a twofold acceleration of the search itself. However, the processing speed of pages faults and I/O will remain the same.
All reactions