This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
overhead of bfd_{get,put}*()
- From: David Miller <davem at davemloft dot net>
- To: binutils at sourceware dot org
- Date: Mon, 22 Feb 2010 17:38:58 -0800 (PST)
- Subject: overhead of bfd_{get,put}*()
Just for kicks I ran a link I perform often under 'perf'
to see what consumes the most cycles in the BFD based
linker on sparc64.
The test case is a Linux kernel link with every possible config option
enabled as a module. In the final kernel link there are about 2.8
million relocations for 'ld' to process.
On my Niagara2 build box the link takes ~8.3 seconds.
The top offenders were, surprisingly for me, bfd_getb64(),
bfd_putb64() and bfd_getb_signed_64(). And it's not because they
touch memory, it's the byte loads and shift/or dance they do.
As a quick hack test I simply converted these functions to use direct
assignments and 64-bit pointer derefs.
This trimmed more than a full second off of the execution time for the
test case. Down to ~7.15s
I don't know what to do about this. It's a more than %10 performance
hit on this test case. But I assume that these routines might have
to access potentially unaligned data right? Unfortunately I was not
able to hit any such case by running the full testsuite, it passed
with my hacks in there :-)
Any comments?