public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/96942] std::pmr::monotonic_buffer_resource causes CPU cache misses
Date: Tue, 08 Sep 2020 11:23:39 +0000	[thread overview]
Message-ID: <bug-96942-4-o2XzUITuMn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96942-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Alexander Monakov from comment #5)
> The main gotcha here is m_b_r does not allocate on construction, but rather
> allocates 2x of the preallocation size on first call to 'allocate', and then
> deallocates when 'release' is called. So it repeatedly calls malloc/free in
> the inner benchmark loop, whereas you custom allocator allocates on
> construction and deallocates on destruction, avoiding repeated malloc/free
> calls in the loop and associated lock contention when multithreaded.

m_b_r really needs a "rewind()" member to mark all allocated memory as unused
again, without actually deallocating it and returning it to the upstream
resource.

  parent reply	other threads:[~2020-09-08 11:23 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05  9:42 [Bug libstdc++/96942] New: " dmitriy.ovdienko at gmail dot com
2020-09-05  9:42 ` [Bug libstdc++/96942] " dmitriy.ovdienko at gmail dot com
2020-09-05  9:43 ` dmitriy.ovdienko at gmail dot com
2020-09-07  7:21 ` dmitriy.ovdienko at gmail dot com
2020-09-07  7:24 ` dmitriy.ovdienko at gmail dot com
2020-09-07 10:49 ` amonakov at gcc dot gnu.org
2020-09-07 16:13 ` dmitriy.ovdienko at gmail dot com
2020-09-07 20:53 ` dmitriy.ovdienko at gmail dot com
2020-09-07 21:21 ` dmitriy.ovdienko at gmail dot com
2020-09-08  7:11 ` amonakov at gcc dot gnu.org
2020-09-08  9:39 ` dmitriy.ovdienko at gmail dot com
2020-09-08 11:19 ` redi at gcc dot gnu.org
2020-09-08 11:23 ` redi at gcc dot gnu.org [this message]
2020-09-08 11:32 ` redi at gcc dot gnu.org
2020-09-08 11:35 ` amonakov at gcc dot gnu.org
2020-09-08 11:48 ` redi at gcc dot gnu.org
2020-09-08 11:49 ` redi at gcc dot gnu.org
2020-09-08 11:50 ` redi at gcc dot gnu.org
2020-09-08 11:58 ` amonakov at gcc dot gnu.org
2020-09-08 12:03 ` redi at gcc dot gnu.org
2020-09-08 12:17 ` amonakov at gcc dot gnu.org
2020-09-08 12:53 ` dmitriy.ovdienko at gmail dot com
2020-09-08 16:13 ` redi at gcc dot gnu.org
2020-09-08 16:28 ` amonakov at gcc dot gnu.org
2020-09-08 16:44 ` redi at gcc dot gnu.org
2020-09-08 17:30 ` redi at gcc dot gnu.org
2020-09-08 20:20 ` dmitriy.ovdienko at gmail dot com
2020-09-08 20:30 ` dmitriy.ovdienko at gmail dot com
2020-09-08 20:36 ` dmitriy.ovdienko at gmail dot com
2020-09-08 20:41 ` dmitriy.ovdienko at gmail dot com
2020-09-08 21:01 ` dmitriy.ovdienko at gmail dot com
2020-09-08 21:33 ` dmitriy.ovdienko at gmail dot com
2020-09-08 21:36 ` dmitriy.ovdienko at gmail dot com
2020-09-08 22:24 ` dmitriy.ovdienko at gmail dot com
2020-09-09  9:10 ` redi at gcc dot gnu.org
2020-09-09  9:49 ` redi at gcc dot gnu.org
2020-09-09 11:59 ` dmitriy.ovdienko at gmail dot com
2020-09-09 12:06 ` dmitriy.ovdienko at gmail dot com
2020-09-10  8:13 ` dmitriy.ovdienko at gmail dot com
2020-09-10 14:42 ` cvs-commit at gcc dot gnu.org
2020-09-10 14:46 ` redi at gcc dot gnu.org
2020-09-10 17:53 ` dmitriy.ovdienko at gmail dot com
2020-09-10 17:57 ` dmitriy.ovdienko at gmail dot com
2020-09-10 18:16 ` 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=bug-96942-4-o2XzUITuMn@http.gcc.gnu.org/bugzilla/ \
    --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).