Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Tom Tromey (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: gdb-patches@sourceware.org
Cc: Christian Biesinger <cbiesinger@google.com>
Subject: [review v3] Demangle minsyms in parallel
Date: Fri, 22 Nov 2019 23:45:00 -0000	[thread overview]
Message-ID: <20191122234536.2488E2816F@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571543710000.I220341f70e94dd02df5dd424272c50a5afb64978@gnutoolchain-gerrit.osci.io>

Tom Tromey has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/173
......................................................................


Patch Set 3:

(1 comment)

| --- /dev/null
| +++ gdb/gdbsupport/parallel-for.h
| @@ -1,0 +45,19 @@ parallel_for_each (RandomIt first, RandomIt last, RangeFunction callback)
| +#if CXX_STD_THREAD
| +  /* So we can use a local array below.  */
| +  const size_t local_max = 16;
| +  size_t n_threads = std::min (thread_pool::g_thread_pool->count (),
| +			       local_max);
| +  size_t n_actual_threads = 0;
| +  std::future<void> futures[local_max];
| +
| +  size_t n_elements = last - first;
| +  if (n_threads > 1 && 2 * n_threads <= n_elements)

PS3, Line 54:

I think this check doesn't really make sense -- if one has many
elements but also many threads available, the answer shouldn't be
to give up.

In the next revision, I've changed it to reduce the number of threads
used when there aren't many elements per thread.  I picked an
arbitrary cutoff of a minimum of 10 elements.

| +    {
| +      size_t elts_per_thread = n_elements / n_threads;
| +      n_actual_threads = n_threads - 1;
| +      for (int i = 0; i < n_actual_threads; ++i)
| +	{
| +	  RandomIt end = first + elts_per_thread;
| +	  auto task = [=] ()
| +		      {
| +			callback (first, end);

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I220341f70e94dd02df5dd424272c50a5afb64978
Gerrit-Change-Number: 173
Gerrit-PatchSet: 3
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Christian Biesinger <cbiesinger@google.com>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-Comment-Date: Fri, 22 Nov 2019 23:45:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


  parent reply	other threads:[~2019-11-22 23:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20  3:55 [review] " Tom Tromey (Code Review)
2019-10-20 11:06 ` Christian Biesinger (Code Review)
2019-10-20 20:55 ` [review v2] " Tom Tromey (Code Review)
2019-10-30 23:00 ` [review v3] " Tom Tromey (Code Review)
2019-11-22 23:45 ` Tom Tromey (Code Review) [this message]
2019-11-22 23:56 ` [review v4] " Tom Tromey (Code Review)
2019-11-26 19:06 ` Pedro Alves (Code Review)
2019-11-26 19:11 ` Pedro Alves (Code Review)
2019-11-26 19:42 ` Tom Tromey (Code Review)
2019-11-26 20:50 ` Tom Tromey (Code Review)
2019-11-26 21:13 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-11-26 21:14 ` Sourceware to Gerrit sync (Code Review)

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=20191122234536.2488E2816F@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=cbiesinger@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gnutoolchain-gerrit@osci.io \
    /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