https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82776
--- Comment #10 from Ben Maurer ---
This appears to be fixed:
https://godbolt.org/z/r49nYx6df
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78103
--- Comment #1 from Ben Maurer ---
Also along the same lines:
https://godbolt.org/g/Nzed5m
GCC figures out BSRNew, but there's a cdqe instruction that's unnecessary
-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: ben.maurer at gmail dot com
Target Milestone: ---
constexpr
unsigned long findLastSet(unsigned long x) {
return x ? 8 * sizeof(unsigned long) - __builtin_clzl(x) : 0;
}
constexpr
unsigned long findLastSet2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439
--- Comment #6 from Ben Maurer ---
I agree this isn't necessarily the cleanest way to accomplish this task.
My discovery of this bug came through a real life application which was
deployed to real users and had a noticeable impact due to this iss
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439
--- Comment #4 from Ben Maurer ---
Also, here's where perf says time is being spent. While only 25% is shown as
being in the locale constructor/destructor, I suspect that the time spent in
other methods is actually related to the ping-ponging of c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439
--- Comment #3 from Ben Maurer ---
Created attachment 31405
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31405&action=edit
Benchmark
_build/opt/experimental/bmaurer/benchmark
snprintf
1 threads took 20 ms
2 threads took 20 ms
3 threads to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439
--- Comment #1 from Ben Maurer ---
Facebook is putting a $50 bounty on this bug via bountysource:
https://www.bountysource.com/issues/1350875
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: ben.maurer at gmail dot com
In a large multithreaded program that uses stringstream to stringify integers,
I have seen that construction and deconstruction of std::locale can take over
10% of the runtime according