1. 09 Jan, 2017 2 commits
    • Robert Griesemer's avatar
      [dev.inline] cmd/internal/src: introduce compact source position representation · 472c792e
      Robert Griesemer authored
      XPos is a compact (8 instead of 16 bytes on a 64bit machine) source
      position representation. There is a 1:1 correspondence between each
      XPos and each regular Pos, translated via a global table.
      
      In some sense this brings back the LineHist, though positions can
      track line and column information; there is a O(1) translation
      between the representations (no binary search), and the translation
      is factored out.
      
      The size increase with the prior change is brought down again and
      the compiler speed is in line with the master repo (measured on
      the same "quiet" machine as for prior change):
      
      name       old time/op     new time/op     delta
      Template       256ms ± 1%      262ms ± 2%    ~             (p=0.063 n=5+4)
      Unicode        132ms ± 1%      135ms ± 2%    ~             (p=0.063 n=5+4)
      GoTypes        891ms ± 1%      871ms ± 1%  -2.28%          (p=0.016 n=5+4)
      Compiler       3.84s ± 2%      3.89s ± 2%    ~             (p=0.413 n=5+4)
      MakeBash       47.1s ± 1%      46.2s ± 2%    ~             (p=0.095 n=5+5)
      
      name       old user-ns/op  new user-ns/op  delta
      Template        309M ± 1%       314M ± 2%    ~             (p=0.111 n=5+4)
      Unicode         165M ± 1%       172M ± 9%    ~             (p=0.151 n=5+5)
      GoTypes        1.14G ± 2%      1.12G ± 1%    ~             (p=0.063 n=5+4)
      Compiler       5.00G ± 1%      4.96G ± 1%    ~             (p=0.286 n=5+4)
      
      Change-Id: Icc570cc60ab014d8d9af6976f1f961ab8828cc47
      Reviewed-on: https://go-review.googlesource.com/34506
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      472c792e
    • Robert Griesemer's avatar
      [dev.inline] cmd/internal/src: replace src.Pos with syntax.Pos · 4808fc44
      Robert Griesemer authored
      This replaces the src.Pos LineHist-based position tracking with
      the syntax.Pos implementation and updates all uses.
      
      The LineHist table is not used anymore - the respective code is still
      there but should be removed eventually. CL forthcoming.
      
      Passes toolstash -cmp when comparing to the master repo (with the
      exception of a couple of swapped assembly instructions, likely due
      to different instruction scheduling because the line-based sorting
      has changed; though this is won't affect correctness).
      
      The sizes of various important compiler data structures have increased
      significantly (see the various sizes_test.go files); this is probably
      the reason for an increase of compilation times (to be addressed). Here
      are the results of compilebench -count 5, run on a "quiet" machine (no
      apps running besides a terminal):
      
      name       old time/op     new time/op     delta
      Template       256ms ± 1%      280ms ±15%  +9.54%          (p=0.008 n=5+5)
      Unicode        132ms ± 1%      132ms ± 1%    ~             (p=0.690 n=5+5)
      GoTypes        891ms ± 1%      917ms ± 2%  +2.88%          (p=0.008 n=5+5)
      Compiler       3.84s ± 2%      3.99s ± 2%  +3.95%          (p=0.016 n=5+5)
      MakeBash       47.1s ± 1%      47.2s ± 2%    ~             (p=0.841 n=5+5)
      
      name       old user-ns/op  new user-ns/op  delta
      Template        309M ± 1%       326M ± 2%  +5.18%          (p=0.008 n=5+5)
      Unicode         165M ± 1%       168M ± 4%    ~             (p=0.421 n=5+5)
      GoTypes        1.14G ± 2%      1.18G ± 1%  +3.47%          (p=0.008 n=5+5)
      Compiler       5.00G ± 1%      5.16G ± 1%  +3.12%          (p=0.008 n=5+5)
      
      Change-Id: I241c4246cdff627d7ecb95cac23060b38f9775ec
      Reviewed-on: https://go-review.googlesource.com/34273
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      4808fc44
  2. 10 Dec, 2016 1 commit
  3. 09 Dec, 2016 11 commits
  4. 08 Dec, 2016 5 commits
  5. 07 Dec, 2016 1 commit
  6. 06 Dec, 2016 10 commits
  7. 05 Dec, 2016 7 commits
  8. 04 Dec, 2016 3 commits