Subject: bin/35589: Dynamic linking is very slow
To: None <,>
From: None <>
List: netbsd-bugs
Date: 02/12/2007 14:25:01
>Number:         35589
>Category:       bin
>Synopsis:       Dynamic linking is very slow
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 12 14:25:00 +0000 2007
>Originator:     Kimura Fuyuki
>Release:        NetBSD 4.99.10
System: NetBSD 4.99.10 NetBSD 4.99.10 (LAPIS) #65: Mon Feb 12 22:45:30 JST 2007 amd64
Architecture: x86_64
Machine: amd64
ld.elf_so is very slow especially in big applications written in C++.
$ time noatun --help>/dev/null
noatun --help > /dev/null  4.90s user 0.04s system 99% cpu 4.963 total
The following patch is to cache the information of the symbols found
in the previous lookups. Taken from DragonFly, amd64 only but it
should be trivial to adapt to the others.

This simple hack sometimes doubles or triples the speed of dynamic
linking.  It's so simple that I can't understand why this hasn't been
introduced before. Any NetBSD specific problem?

$ time noatun --help>/dev/null
noatun --help > /dev/null  1.47s user 0.10s system 99% cpu 1.581 total