public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "devison at pacificit dot co dot nz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/13823] Significant performance issue with std::map on multiple threads on dual processor - possibly default allocator
Date: Fri, 23 Jan 2004 12:48:00 -0000	[thread overview]
Message-ID: <20040123124836.22750.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040123001452.13823.devison@pacificit.co.nz>


------- Additional Comments From devison at pacificit dot co dot nz  2004-01-23 12:48 -------
Subject: Re:  Significant performance issue with std::map
 on multiple threads on dual processor - possibly default allocator


> Please apply this patch and rerun your test (it would also be great if
> you could tell us whether your real application code sees major
> improvement using this allocator with an MP machine; I know that might
> be a little more work)...


Hi Loren,

well, the patch improved things significantly on the test.  For example:
one thread, one cpu:   17.4s
two threads, one cpu:  35.0s
two threads, two cpus: 29.5s

So now, it seems that when the two threads are running the performance is
only slightly lower on two cpus than on one.  ie this is about 4 times
faster than the previous version.  Of course, it is still unfortunate that
it is *slower* with an extra cpu.

I've been working to integrate this into my application to test it properly,
and it has been a real hassle!  Luckily I use typedefs for every container
class type, but still have 20 std::set types, 58 std::map types, 13
std::hash_map types, 97 std::vector types and 8 std::deque types.  I've used
the "template typdef" technique described in:
http://www.gotw.ca/gotw/079.htm  so at least I can now change which
allocator is used in one place.

I also make extensive use of std::string which also (of course) uses the
allocator.   Redefining a new string type using the mt_allocator has been a
major hassle.  I'm using lots of other libraries that return and accept
ordinary std::strings, and of course the two strings aren't interchangeable.
Also I've started defining new instantiations of basic_ostringstream rather
than using ostringstream, etc.

There's got to be a better way!

any ideas...?

thanks,
Dan






-- 


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


  parent reply	other threads:[~2004-01-23 12:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-23  0:15 [Bug c++/13823] New: " devison at pacificit dot co dot nz
2004-01-23  0:18 ` [Bug c++/13823] " devison at pacificit dot co dot nz
2004-01-23  0:49 ` richard at redspider dot co dot nz
2004-01-23  2:34 ` [Bug libstdc++/13823] " pinskia at gcc dot gnu dot org
2004-01-23  2:41 ` devison at pacificit dot co dot nz
2004-01-23  2:44 ` pinskia at gcc dot gnu dot org
2004-01-23  3:26 ` rittle at latour dot rsch dot comm dot mot dot com
2004-01-23  3:38 ` ljrittle at gcc dot gnu dot org
2004-01-23  3:58 ` devison at pacificit dot co dot nz
2004-01-23  3:58 ` ljrittle at gcc dot gnu dot org
2004-01-23  4:14 ` rittle at latour dot rsch dot comm dot mot dot com
2004-01-23  5:31 ` devison at pacificit dot co dot nz
2004-01-23  6:01 ` rittle at latour dot rsch dot comm dot mot dot com
2004-01-23 12:48 ` devison at pacificit dot co dot nz [this message]
2004-01-23 20:47 ` rittle at latour dot rsch dot comm dot mot dot com
     [not found] <bug-13823-4@http.gcc.gnu.org/bugzilla/>
2024-06-13 14:30 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040123124836.22750.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).