[Bug libstdc++/96942] std::pmr::monotonic_buffer_resource causes CPU cache misses

dmitriy.ovdienko at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Sep 8 09:39:30 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96942

--- Comment #10 from Dmitriy Ovdienko <dmitriy.ovdienko at gmail dot com> ---
Looks like I know why C++ sample does not use all the CPU resources.

C++ does not load threads equally. Last thread gets the most heavy task
(MAX_DEPTH) and performs N iterations alone.

Rust code instead creates a loop from MIN_DEPTH..MAX_DEPTH and runs iterations
in the threads. So at first, N threads are working on Depth=1, then all the
threads are working on Depth=2... and then all the threads are working on
Depth=MAX


More information about the Gcc-bugs mailing list