[Bug libstdc++/111588] Provide opt-out of shared_ptr single-threaded optimization

2023-10-27 Thread redbeard0531 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111588 --- Comment #5 from Mathias Stearn --- Mea culpa. The difference between boost and std was due to the code to fast-path shared_ptrs that aren't actually shared: https://github.com/gcc-mirror/gcc/blob/be34a8b538c0f04b11a428bd1a9340eb19dec13f/libs

[Bug libstdc++/111588] Provide opt-out of shared_ptr single-threaded optimization

2023-10-27 Thread redbeard0531 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111588 --- Comment #4 from Mathias Stearn --- So even though I already knew in the back of my mind about how this can affect benchmark results, I *still* got burned by it! I was benchmarking a simple hazard pointer implementation against shared ptrs by

[Bug libstdc++/111588] Provide opt-out of shared_ptr single-threaded optimization

2023-09-27 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111588 --- Comment #3 from Jonathan Wakely --- If we do want to do it, I think we'd just need something like this (and docs): --- a/libstdc++-v3/include/ext/atomicity.h +++ b/libstdc++-v3/include/ext/atomicity.h @@ -48,6 +48,8 @@ _GLIBCXX_BEGIN_NAMESP

[Bug libstdc++/111588] Provide opt-out of shared_ptr single-threaded optimization

2023-09-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111588 --- Comment #2 from Jonathan Wakely --- This needs numbers, not opinions.

[Bug libstdc++/111588] Provide opt-out of shared_ptr single-threaded optimization

2023-09-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111588 --- Comment #1 from Andrew Pinski --- >for programs that know they are effectively always multithreaded they pay for >a runtime branch and .text segment bloat for an optimization that never >applies. The bloat is not much and the overhead for