diff options
| author | Russ Cox <rsc@golang.org> | 2011-04-09 09:44:20 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2011-04-09 09:44:20 -0400 |
| commit | 1bc84b7e18ae704483ab028bb2030970bbc0b2f3 (patch) | |
| tree | b3cc18d44af119730dd6e8a3a28abd3c5aa24d7b /src/cmd/ld/data.c | |
| parent | ebaf01f0526f349dd207798dc5771219e9d8a8ca (diff) | |
| download | go-1bc84b7e18ae704483ab028bb2030970bbc0b2f3.tar.xz | |
ld: 25% faster
The ld time was dominated by symbol table processing, so
* increase hash table size
* emit fewer symbols in gc (just 1 per string, 1 per type)
* add read-only lookup to avoid creating spurious symbols
* add linked list to speed whole-table traversals
Breaks dwarf generator (no idea why), so disable dwarf.
Reduces time for 6l to link godoc by 25%.
R=ken2
CC=golang-dev
https://golang.org/cl/4383047
Diffstat (limited to 'src/cmd/ld/data.c')
| -rw-r--r-- | src/cmd/ld/data.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/cmd/ld/data.c b/src/cmd/ld/data.c index 5d7394463d..32dba45964 100644 --- a/src/cmd/ld/data.c +++ b/src/cmd/ld/data.c @@ -733,18 +733,16 @@ dodata(void) last = nil; datap = nil; - for(h=0; h<NHASH; h++) { - for(s=hash[h]; s!=S; s=s->hash){ - if(!s->reachable || s->special) - continue; - if(STEXT < s->type && s->type < SXREF) { - if(last == nil) - datap = s; - else - last->next = s; - s->next = nil; - last = s; - } + for(s=allsym; s!=S; s=s->allsym) { + if(!s->reachable || s->special) + continue; + if(STEXT < s->type && s->type < SXREF) { + if(last == nil) + datap = s; + else + last->next = s; + s->next = nil; + last = s; } } |
