abseil / abseil-cpp

Abseil Common Libraries (C++)

Home Page:https://abseil.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Portable implementation in raw hash set optimization for 32-bit systems

christian-herber-nxp opened this issue · comments

The group size in the portable implementation is explicitly optimized for 64-bit systems. This is done through a 64-bit control word

ctrl(little_endian::Load64(pos))
static constexpr size_t kWidth = 8;

and a number of 64-bit masks for the bit magic stuff that's done for matching.
I wonder if it was a conscious choice to to make this scale down for 32-bit systems basing dimensions on size_t rather than uint64_t. I did measure improvement in both hit and miss performance

As a general rule, Abseil engineers test at scale for performance on x86-64 Linux servers. Any optimizations for other platforms are usually added later on by users of other platforms when they notice performance issues.