Details
-
Type:
Task
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Fix Version/s: 10.5.0
-
Component/s: Server
-
Labels:
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