<pre class="notranslate">Profiling vet on a large corpus shows about &gt;10% time spent in syscalls initiated by
gcimporter.(*parser).next. Many of these reads are avoidable; there is high import
overlap across packages, particularly within a given project.

Concretely, instrumenting calls to Import (in gcimporter.go) and then running 'go vet'
on camlistore yields these top duplicate imports:

 153 fmt.a
 147 testing.a
 120 io.a
 119 strings.a
 113 os.a
 108 bytes.a
  99 time.a
  97 errors.a
  82 io/ioutil.a
  80 log.a
  76 sync.a
  70 strconv.a
  64 net/http.a
  56 path/filepath.a
  51 camlistore.org/pkg/blob.a
  44 runtime.a
  39 sort.a
  39 flag.a
  35 reflect.a
  35 net/url.a
  
These 20 account for 1627 of the 2750 import reads.

Hacking in a quick LRU that simply caches the raw data in the files cuts 'go vet' user
time for camlistore by ~10%. I'm not sure that that is the right long-term approach,
though.</pre>
<pre class="notranslate">Currently gc generates the following code:

    var s1 string
  400c19:   48 c7 44 24 08 00 00    movq   $0x0,0x8(%rsp)
  400c22:   48 c7 44 24 10 00 00    movq   $0x0,0x10(%rsp)

    s2 := ""
  400c2b:   48 8d 1c 25 20 63 42    lea    0x426320,%rbx
  400c33:   48 8b 2b                mov    (%rbx),%rbp
  400c36:   48 89 6c 24 18          mov    %rbp,0x18(%rsp)
  400c3b:   48 8b 6b 08             mov    0x8(%rbx),%rbp
  400c3f:   48 89 6c 24 20          mov    %rbp,0x20(%rsp)

    s3 = ""
  400c44:   48 8d 1c 25 20 63 42    lea    0x426320,%rbx
  400c4c:   48 8b 2b                mov    (%rbx),%rbp
  400c4f:   48 89 2c 25 f0 34 46    mov    %rbp,0x4634f0
  400c57:   48 8b 6b 08             mov    0x8(%rbx),%rbp
  400c5b:   48 89 2c 25 f8 34 46    mov    %rbp,0x4634f8

Ideally it is:

    var s1 string
  400c19:   48 c7 44 24 08 00 00    movq   $0x0,0x8(%rsp)
  400c22:   48 c7 44 24 10 00 00    movq   $0x0,0x10(%rsp)

    s2 := ""
  400c19:   48 c7 44 24 08 00 00    movq   $0x0,0x8(%rsp)
  400c22:   48 c7 44 24 10 00 00    movq   $0x0,0x10(%rsp)

    s3 = ""
  400c19:   48 c7 44 24 08 00 00    movq   $0x0,0x8(%rsp)
  400c22:   48 c7 44 24 10 00 00    movq   $0x0,0x10(%rsp)

For := "", compiler can just remove the initializer.
For = "", compiler can recognize "" and store zeros.</pre>