[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LD profiling suggests it's performance can be improved
From: |
Yuri |
Subject: |
LD profiling suggests it's performance can be improved |
Date: |
Thu, 14 Aug 2003 16:21:20 -0700 |
User-agent: |
Internet Messaging Program (IMP) 3.2.1 |
I profiled "ld" while running on medium-sized C++ project with about 60K total
symbols (as reported by "nm <executable>").
Profiling data suggests that over 85% of time is spent in functions
"htab_find_slot_with_hash" and "last_eq" in libiberty library.
Unfortunately for some reason gprof wasn't able to write detailed report on
per-line basis but I suspect that the reason is that "ld" uses unmangled names
for hash and hash's non-uniformity factor is very high.
Other hint is that we use lots of templates with numerous branched
specializations and ratio #mangled/#non-mangled is often in the hundreds for
names (580 for one of the names). So there's a lot of collisions in hash in
"htab_find_slot_with_hash".
Thanx,
Yuri
PS: Reason I did all these experiments is that linking takes about 1-2 minutes
which seems too high.
---------gprof report-------------------------------
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
43.72 21.60 21.60 87073 0.25 0.50 htab_find_slot_with_hash
41.46 42.08 20.48 153889424 0.00 0.00 last_eq
3.40 43.76 1.68 10303941 0.00 0.00 last4_eq
2.65 45.07 1.31 259059 0.01 0.01 bfd_hash_lookup
1.75 45.94 0.86 9452526 0.00 0.00 wildcardp
1.61 46.73 0.80 680907 0.00 0.00 sec_merge_hash_lookup
1.21 47.33 0.60 2408 0.25 0.62 walk_wild_section
1.09 47.87 0.54 11692 0.05 0.05 add_line_info
0.34 48.04 0.17 34589 0.00 0.05 elf_i386_relocate_section
0.28 48.18 0.14 5549788 0.00 0.00 bfd_getl32
0.20 48.28 0.10 34589 0.00 0.01 elf_i386_check_relocs
0.18 48.37 0.09 25 3.60 72.74 elf_link_input_bfd
0.17 48.45 0.09 1239094 0.00 0.00 _bfd_relocate_contents
0.16 48.53 0.08 31 2.58 32.29
elf_link_add_object_symbols
0.14 48.60 0.07 475918 0.00 0.00 _bfd_merged_section_offset
0.10 48.66 0.05 1902353 0.00 0.00 bfd_putl32
0.08 48.70 0.04 3 13.33 14565.49 merge_strings
0.06 48.73 0.03 298999 0.00 0.00 bfd_hash_allocate
0.06 48.76 0.03 109364 0.00 0.00 elf_link_output_extsym
0.06 48.78 0.03 32142 0.00 0.00
_bfd_strip_section_from_output
0.05 48.81 0.03 1239094 0.00 0.00 _bfd_final_link_relocate
0.04 48.83 0.02 1287139 0.00 0.00 bfd_elf32_swap_reloc_in
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- LD profiling suggests it's performance can be improved,
Yuri <=