orconce: Use Win32 once implementation
Hi all,
This MR supersedes !112 (closed) after some benchmarking and profiling with MSVC 17.9.0 preview 1 and Clang 17.0.4 (UCRT64). I couldn't override the original MR so am filing a separate one.
(from !112 (closed))
InitOnceBeginInitialize()
is slightly faster than the manual implementation. Note that MSVC std::call_once()
is implemented by using the Win32 API as well.
(my own insights)
- Why @seungha.yang 's approach is the correct one: !112 (comment 2182895)
- Why, in this MR, I narrowed it down to only MSVC following profiling: !112 (comment 2183081)
Closes !112 (closed)