This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Fix elf-strtab.c performance problem
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 18 Dec 2001 19:15:12 +1030
- Subject: Re: [PATCH] Fix elf-strtab.c performance problem
- References: <20011217190416.L542@sunsite.ms.mff.cuni.cz>
On Mon, Dec 17, 2001 at 07:04:16PM +0100, Jakub Jelinek wrote:
>
> * elf-strtab.c (struct elf_strtab_hash_entry): Add u.next.
> (last_eq): Remove.
> (_bfd_elf_strtab_finalize): Don't use a hash table for last
> character chains, instead use an array.
OK.
> + c = e->root.string[e->len - 2] & 0xff;
> + /* Put longest strings first. */
Errant comment?
Also, a slightly more tidy way to add to lists, but please yourself over
this suggestion:
struct elf_strtab_hash_entry **last_ptr[256];
.
.
for (i = 0; i < 256; i++)
last_ptr[i] = &last[i];
.
.
*last_ptr[i] = e;
last_ptr[i] = &e->next;
Alan