public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/59439] New: std::locale uses atomic instructions on construction
@ 2013-12-09 21:56 ben.maurer at gmail dot com
  2013-12-09 21:59 ` [Bug libstdc++/59439] " ben.maurer at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ben.maurer at gmail dot com @ 2013-12-09 21:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439

            Bug ID: 59439
           Summary: std::locale uses atomic instructions on construction
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         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 to the perf tool.

In bug 40088, std::locale was optimized to avoid the usage of a mutex when
creating the default locale. In our program, this path is being exercised.
However, the act of doing ref counting still has a very large performance
penalty on SMP systems due to cache line bouncing.

If this locale is truly readonly, it would be much better if refcounting could
be avoided. Maybe a refcount of -1 could signify "this object need not be
refcounted".


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-04-20  8:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-09 21:56 [Bug libstdc++/59439] New: std::locale uses atomic instructions on construction ben.maurer at gmail dot com
2013-12-09 21:59 ` [Bug libstdc++/59439] " ben.maurer at gmail dot com
2013-12-09 23:55 ` pinskia at gcc dot gnu.org
2013-12-10  0:39 ` ben.maurer at gmail dot com
2013-12-10  0:54 ` ben.maurer at gmail dot com
2013-12-10 23:59 ` redi at gcc dot gnu.org
2013-12-11  0:23 ` ben.maurer at gmail dot com
2014-04-20  8:33 ` antoshkka at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).