This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ping^2: [patchv2] Fix 100x slowdown regression on DWZ files


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]