Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL)
-
None
Description
By CMake's default, RelWithDebInfo compiles with /Ob1 option, which is inlining everything that is marked for inlining but nothing else (see reference). However certain template function in the SDK are not explicitely marked inline. Which makes compiler to create non-inlined functions. In some situations this does not work very well . For example atomic store (including memory_order_relaxed) would call a template function Atomic_reinterpret_as() ,which was compiled for some template parameters, to a dummy function.
If more agressive inlining is enabled, like /Ob2 (default for Release/MinSizeRel), then Atomic_reinterpret_as generates no instructions.
Given Innodb's extensive use for atomics (specifically relaxed ones, to please TSAN), the call() instruction overhead on every load of atomic becomes too high, and measurable in recent 10.8 benchmarks, as much as 5-10%.