Details
-
Task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
Description
Table_map_iterator in sql_bitmap.h iterates over all bits set in a ulonglong variable.
Current implementation shows that there was an attempt to make it optimized, with prebuilt small offset table, and this gives in my tests about 30% improvement over naïve implementation.
But as I found during my test, using compiler intrinsics such as _builtin_ctzll(GCC,Clang) or _BitScanForward64(MSVC) can speed it up further by 200-300% over the current implementation.
intrinsics map to bsf instructions on Intel processors