1. 01 Oct, 2019 6 commits
    • Alex Brainman's avatar
      cmd/link: MapViewOfFile output file · af880809
      Alex Brainman authored
      CL 170738 used mmap for writing most of the output file content.
      
      This change implements similar functionality for Windows.
      
      The output of
      
      compilebench -count=5
      
      command before and after this change
      
      name                      old time/op       new time/op       delta
      Template                        254ms ±14%        239ms ±10%    ~     (p=0.222 n=5+5)
      Unicode                         119ms ±14%        113ms ±12%    ~     (p=0.421 n=5+5)
      GoTypes                         892ms ±23%        850ms ± 1%    ~     (p=0.841 n=5+5)
      Compiler                        3.86s ± 2%        3.82s ± 1%    ~     (p=0.222 n=5+5)
      SSA                             12.6s ± 1%        12.6s ± 1%    ~     (p=0.095 n=5+5)
      Flate                           162ms ±18%        149ms ± 1%  -7.91%  (p=0.016 n=5+5)
      GoParser                        199ms ±12%        184ms ± 1%    ~     (p=0.056 n=5+5)
      Reflect                         524ms ±13%        507ms ± 3%    ~     (p=0.421 n=5+5)
      Tar                             207ms ± 7%        198ms ± 0%  -4.58%  (p=0.016 n=5+4)
      XML                             305ms ± 6%        299ms ± 5%    ~     (p=0.690 n=5+5)
      LinkCompiler                    1.14s ±11%        1.14s ± 3%    ~     (p=0.222 n=5+5)
      ExternalLinkCompiler            2.80s ± 5%        2.92s ±13%    ~     (p=0.222 n=5+5)
      LinkWithoutDebugCompiler        727ms ± 2%        750ms ± 7%    ~     (p=0.151 n=5+5)
      StdCmd                          44.0s ± 8%        43.3s ± 2%    ~     (p=1.000 n=5+5)
      
      name                      old user-time/op  new user-time/op  delta
      Template                        300ms ±27%        259ms ±34%    ~     (p=0.341 n=5+5)
      Unicode                         134ms ±51%        144ms ±67%    ~     (p=0.548 n=5+5)
      GoTypes                         1.05s ±10%        1.03s ± 6%    ~     (p=0.968 n=5+5)
      Compiler                        5.01s ± 3%        4.88s ± 3%    ~     (p=0.286 n=5+5)
      SSA                             16.8s ± 1%        16.7s ± 1%  -0.95%  (p=0.008 n=5+5)
      Flate                           178ms ±67%        181ms ±38%    ~     (p=0.849 n=5+5)
      GoParser                        231ms ±32%        219ms ±21%    ~     (p=0.810 n=5+5)
      Reflect                         634ms ±33%        650ms ± 6%    ~     (p=0.135 n=5+5)
      Tar                             219ms ±36%        231ms ±19%    ~     (p=0.905 n=5+5)
      XML                             378ms ±20%        366ms ±23%    ~     (p=0.913 n=5+5)
      LinkCompiler                    1.34s ±15%        1.32s ±10%    ~     (p=0.730 n=5+5)
      ExternalLinkCompiler            1.22s ±13%        1.18s ±15%    ~     (p=0.873 n=5+5)
      LinkWithoutDebugCompiler        847ms ±13%        841ms ±21%    ~     (p=0.667 n=5+5)
      
      name                      old text-bytes    new text-bytes    delta
      HelloSize                       767kB ± 0%        767kB ± 0%    ~     (all equal)
      CmdGoSize                      10.6MB ± 0%       10.6MB ± 0%    ~     (all equal)
      
      name                      old data-bytes    new data-bytes    delta
      HelloSize                      10.1kB ± 0%       10.1kB ± 0%    ~     (all equal)
      CmdGoSize                       310kB ± 0%        310kB ± 0%    ~     (all equal)
      
      name                      old bss-bytes     new bss-bytes     delta
      HelloSize                       0.00B             0.00B         ~     (all equal)
      CmdGoSize                       0.00B             0.00B         ~     (all equal)
      
      name                      old exe-bytes     new exe-bytes     delta
      HelloSize                      1.10MB ± 0%       1.10MB ± 0%    ~     (all equal)
      CmdGoSize                      14.7MB ± 0%       14.7MB ± 0%    ~     (all equal)
      
      Change-Id: I653f63213b9cc8a4b05f71938e34b5d53b05e3f5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/196846
      Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      af880809
    • Ariel Mashraki's avatar
      text/template/parse: use strings.Builder in String methods · 4f13a9c5
      Ariel Mashraki authored
      As mentioned in godoc, strings.Builder is more efficient for
      concatenating and building strings.
      Running a simple bench test on VariableNode.String() gives:
      
      benchmark                     old ns/op     new ns/op     delta
      BenchmarkParseLarge-8         25676831      24453285      -4.77%
      BenchmarkVariableString-8     296           115           -61.15%
      
      benchmark                     old allocs     new allocs     delta
      BenchmarkVariableString-8     8              3              -62.50%
      
      benchmark                     old bytes     new bytes     delta
      BenchmarkVariableString-8     112           72            -35.71%
      
      Change-Id: I13c9340080738fcad1edeed859d33ba608e4b05a
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198078Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
      Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      4f13a9c5
    • Shenghou Ma's avatar
      runtime: fix darwin syscall performance regression · c1635ad8
      Shenghou Ma authored
      While understanding why syscall.Read is 2x slower on darwin/amd64, I found
      out that, contrary to popular belief, the slowdown is not due to the migration
      to use libSystem.dylib instead of direct SYSCALLs, i.e., CL 141639 (and #17490),
      but due to a subtle change introduced in CL 141639.
      
      Previously, syscall.Read used syscall.Syscall(SYS_READ), whose preamble called
      runtime.entersyscall, but after CL 141639, syscall.Read changes to call
      runtime.syscall_syscall instead, which in turn calls runtime.entersyscallblock
      instead of runtime.entersyscall. And the entire 2x slow down can be attributed
      to this change.
      
      I think this is unnecessary as even though syscalls like Read might block, it
      does not always block, so there is no need to handoff P proactively for each
      Read. Additionally, we have been fine with not handing off P for each Read
      prior to Go 1.12, so we probably don't need to change it. This changes restores
      the pre-Go 1.12 behavior, where syscall preamble uses runtime.entersyscall,
      and we rely on sysmon to take P back from g blocked in syscalls.
      
      Change-Id: If76e97b5a7040cf1c10380a567c4f5baec3121ba
      Reviewed-on: https://go-review.googlesource.com/c/go/+/197938
      Run-TryBot: Minux Ma <minux@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      c1635ad8
    • Andrew Bonventre's avatar
      cmd/go/internal/modfetch: update TestCodeRepo for gopkg.in/yaml.v2 · e617141b
      Andrew Bonventre authored
      The new yaml.v2 release broke the longtest builder. Update the expected
      data.
      
      Updates #28856
      
      Change-Id: I98ec9e32e55bdb6b26b67e46dc16f34f77c2d40f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198117Reviewed-by: default avatarDmitri Shuralyov <dmitshur@golang.org>
      e617141b
    • John Papandriopoulos's avatar
      cmd/link: load symbols from .syso in external link mode · 5e514b76
      John Papandriopoulos authored
      Fix linking with a package having a .syso file in external link mode,
      that would otherwise cause an error before executing the external
      linker because it can't find symbols that are exported in the said
      .syso file.
      
      Fixes #33139
      
      Change-Id: Id3ee737fba1c6f1e37910593dfedf9c84486d398
      Reviewed-on: https://go-review.googlesource.com/c/go/+/186417Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      5e514b76
    • Rob Pike's avatar
      text/template: further simplify building the vars list · 27cf81e1
      Rob Pike authored
      Followup to https://golang.org/cl/197997
      
      If you know the number of elements, you don't need append at all.
      Either use append to grow, or allocate and index. Here we choose
      number 2.
      
      Change-Id: Ic58637231789640ff7b293ece04a95a8de7ccf8f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/198097Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      27cf81e1
  2. 30 Sep, 2019 10 commits
  3. 29 Sep, 2019 3 commits
  4. 28 Sep, 2019 4 commits
  5. 27 Sep, 2019 10 commits
  6. 26 Sep, 2019 7 commits