public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: ping^2: [patchv2] Fix 100x slowdown regression on DWZ files
Date: Mon, 12 Jan 2015 17:26:00 -0000	[thread overview]
Message-ID: <CADPb22SKYChcmH=iTN6mgxw6VG+saAsvCcLbgtyn5wUpzFiDtw@mail.gmail.com> (raw)
In-Reply-To: <20150112171322.GA14267@host2.jankratochvil.net>

On Mon, Jan 12, 2015 at 9:13 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Fri, 09 Jan 2015 01:32:27 +0100, Doug Evans wrote:
>> Doug Evans writes:
>>  > Do hashtables support calling htab_find_slot with INSERT but then
>>  > not assigning the slot a value if it was empty?
>>  > I could be wrong but I think it does.
>>  > If so, we can remove one call to htab_find_slot here.
>>
>> I was wrong.
>> I thought I was, but I couldn't remember, and couldn't remember where
>> I had seen this.  But htab_find_slot_with_hash does assume
>> that if you call it with INSERT, and the slot isn't already used,
>> then you're going to fill in the slot.
>> No matter, it was just a thought.
>
> Maybe one could use HTAB_DELETED_ENTRY in such case?
>
> But I find that needless microoptimization.  This is solved by compilers this
> century.  And much faster avoiding all the pointer dereferences which is all
> that matters.
>
> But I can use at least htab_find_slot_with_hash instead of htab_find_slot.

For reference sake,
This was never about "microoptimization".
It was about code readability.

  reply	other threads:[~2015-01-12 17:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 19:44 [patch] " Jan Kratochvil
2014-10-01 23:51 ` Doug Evans
2014-10-01 23:57   ` Doug Evans
2014-10-02 15:57   ` [patchv2] " Jan Kratochvil
2014-11-28 21:29     ` ping: " Jan Kratochvil
2014-12-31 19:23     ` ping^2: " Jan Kratochvil
2015-01-08  1:45       ` Doug Evans
2015-01-09  0:32         ` Doug Evans
2015-01-12 17:13           ` Jan Kratochvil
2015-01-12 17:26             ` Doug Evans [this message]
2015-01-14 20:26         ` [patchv3] " Jan Kratochvil
2015-01-22 18:46           ` Doug Evans
2015-01-22 18:57             ` Jan Kratochvil
2015-01-24 12:32               ` Doug Evans
2015-01-24 21:27                 ` [commit+7.9] " Jan Kratochvil
2015-01-25 16:17                   ` Jan Kratochvil

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='CADPb22SKYChcmH=iTN6mgxw6VG+saAsvCcLbgtyn5wUpzFiDtw@mail.gmail.com' \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /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).