This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: Speed up ELF section merge
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 30 Apr 2005 12:40:30 -0700
- Subject: PATCH: Speed up ELF section merge
The default BFD hash table size is too small for ELF section merge.
This patch speeds up sec_merge_hash_lookup by 50% in average.
H.J.
---
2005-04-30 H.J. Lu <hongjiu.lu@intel.com>
* hash.c (hash_size_primes): Add 65537.
* merge.c (sec_merge_init): Call bfd_hash_set_default_size to
set hash table size to 16699.
--- bfd/hash.c.hash 2005-03-22 17:25:46.000000000 -0800
+++ bfd/hash.c 2005-04-30 12:25:59.000000000 -0700
@@ -492,7 +492,7 @@ bfd_hash_set_default_size (bfd_size_type
/* Extend this prime list if you want more granularity of hash table size. */
static const bfd_size_type hash_size_primes[] =
{
- 1021, 4051, 8599, 16699
+ 1021, 4051, 8599, 16699, 65537
};
size_t index;
--- bfd/merge.c.hash 2005-04-14 10:51:43.000000000 -0700
+++ bfd/merge.c 2005-04-30 12:31:22.000000000 -0700
@@ -241,6 +241,8 @@ sec_merge_init (unsigned int entsize, bf
if (table == NULL)
return NULL;
+ bfd_hash_set_default_size (16699);
+
if (! bfd_hash_table_init (&table->table, sec_merge_hash_newfunc))
{
free (table);