Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(300)

Issue 4383047: code review 4383047: ld: 25% faster (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by rsc
Modified:
13 years, 11 months ago
Reviewers:
ken3
CC:
ken2, golang-dev
Visibility:
Public.

Description

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%.

Patch Set 1 #

Patch Set 2 : diff -r 4fb77130a7ef https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 543d4c83a379 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+303 lines, -561 lines) Patch
M src/cmd/5g/gobj.c View 1 5 chunks +43 lines, -143 lines 0 comments Download
M src/cmd/5l/l.h View 1 2 2 chunks +1 line, -1 line 0 comments Download
M src/cmd/6g/gobj.c View 1 5 chunks +34 lines, -140 lines 0 comments Download
M src/cmd/6l/asm.c View 1 2 1 chunk +24 lines, -27 lines 0 comments Download
M src/cmd/6l/l.h View 1 2 2 chunks +1 line, -1 line 0 comments Download
M src/cmd/6l/obj.c View 1 2 5 chunks +9 lines, -9 lines 0 comments Download
M src/cmd/8g/gobj.c View 1 3 chunks +32 lines, -138 lines 0 comments Download
M src/cmd/8l/l.h View 1 2 2 chunks +1 line, -1 line 0 comments Download
M src/cmd/gc/go.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M src/cmd/gc/lex.c View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/cmd/gc/obj.c View 1 1 chunk +54 lines, -0 lines 0 comments Download
M src/cmd/gc/reflect.c View 1 15 chunks +28 lines, -19 lines 0 comments Download
M src/cmd/ld/data.c View 1 2 1 chunk +10 lines, -12 lines 0 comments Download
M src/cmd/ld/dwarf.c View 1 3 chunks +3 lines, -7 lines 0 comments Download
M src/cmd/ld/elf.c View 1 2 2 chunks +17 lines, -19 lines 0 comments Download
M src/cmd/ld/go.c View 1 2 2 chunks +4 lines, -7 lines 0 comments Download
M src/cmd/ld/lib.h View 1 2 3 chunks +4 lines, -0 lines 0 comments Download
M src/cmd/ld/lib.c View 1 2 4 chunks +22 lines, -6 lines 0 comments Download
M src/cmd/ld/pe.c View 1 2 2 chunks +2 lines, -6 lines 0 comments Download
M src/cmd/ld/symtab.c View 1 2 3 chunks +10 lines, -22 lines 0 comments Download

Messages

Total messages: 3
rsc
Hello ken2 (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 11 months ago (2011-04-09 13:44:19 UTC) #1
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=9a64273f9d68 *** ld: 25% faster The ld time was dominated by symbol ...
13 years, 11 months ago (2011-04-09 13:44:27 UTC) #2
ken3
13 years, 11 months ago (2011-04-10 22:04:40 UTC) #3
lgtm

i think that you can still save time in the
lookups across the whole sym table by
putting a test before the call to strncmp.
example:

for(s = allsym; s != S; s = s->allsym) {
      if(s->name[0] == 't')
      if(strncmp(s->name, "type.", 5) == 0) {


On Sat, Apr 9, 2011 at 6:44 AM,  <rsc@golang.org> wrote:
> *** Submitted as
> http://code.google.com/p/go/source/detail?r=9a64273f9d68 ***
>
> 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
> http://codereview.appspot.com/4383047
>
>
> http://codereview.appspot.com/4383047/
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b