1. 04 Sep, 2018 4 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: prefer rematerializeable arg0 for HMUL · 24e51bbe
      Josh Bleecher Snyder authored
      This prevents accidental regalloc regressions
      that otherwise can occur from unrelated changes.
      
      Change-Id: Iea356fb1a24766361fce13748dc1b46e57b21cea
      Reviewed-on: https://go-review.googlesource.com/129375
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      24e51bbe
    • Josh Bleecher Snyder's avatar
      encoding/binary: simplify Read and Write · 2179e495
      Josh Bleecher Snyder authored
      There's no need to manually manage the backing slice for bs.
      Removing it simplifies the code, removes some allocations,
      and speeds it up slightly.
      
      Fixes #27403
      
      name                     old time/op    new time/op    delta
      ReadSlice1000Int32s-8      6.39µs ± 1%    6.31µs ± 1%   -1.37%  (p=0.000 n=27+27)
      ReadStruct-8               1.25µs ± 2%    1.23µs ± 2%   -1.06%  (p=0.003 n=30+29)
      ReadInts-8                  301ns ± 0%     297ns ± 1%   -1.21%  (p=0.000 n=27+30)
      WriteInts-8                 325ns ± 1%     320ns ± 1%   -1.59%  (p=0.000 n=26+29)
      WriteSlice1000Int32s-8     6.60µs ± 0%    6.52µs ± 0%   -1.23%  (p=0.000 n=28+27)
      PutUint16-8                0.72ns ± 2%    0.71ns ± 2%     ~     (p=0.286 n=30+30)
      PutUint32-8                0.71ns ± 1%    0.71ns ± 0%   -0.42%  (p=0.003 n=30+25)
      PutUint64-8                0.78ns ± 2%    0.78ns ± 0%   -0.55%  (p=0.001 n=30+27)
      LittleEndianPutUint16-8    0.57ns ± 0%    0.57ns ± 0%     ~     (all equal)
      LittleEndianPutUint32-8    0.57ns ± 0%    0.57ns ± 0%     ~     (all equal)
      LittleEndianPutUint64-8    0.57ns ± 0%    0.57ns ± 0%     ~     (all equal)
      PutUvarint32-8             23.1ns ± 1%    23.1ns ± 1%     ~     (p=0.925 n=26+29)
      PutUvarint64-8             57.5ns ± 2%    57.3ns ± 1%     ~     (p=0.338 n=30+26)
      [Geo mean]                 23.0ns         22.9ns        -0.61%
      
      name                     old speed      new speed      delta
      ReadSlice1000Int32s-8     626MB/s ± 1%   634MB/s ± 1%   +1.38%  (p=0.000 n=27+27)
      ReadStruct-8             60.2MB/s ± 2%  60.8MB/s ± 2%   +1.08%  (p=0.002 n=30+29)
      ReadInts-8                100MB/s ± 1%   101MB/s ± 1%   +1.24%  (p=0.000 n=27+30)
      WriteInts-8              92.2MB/s ± 1%  93.6MB/s ± 1%   +1.56%  (p=0.000 n=26+29)
      WriteSlice1000Int32s-8    606MB/s ± 0%   614MB/s ± 0%   +1.24%  (p=0.000 n=28+27)
      PutUint16-8              2.80GB/s ± 1%  2.80GB/s ± 1%     ~     (p=0.095 n=28+29)
      PutUint32-8              5.61GB/s ± 1%  5.62GB/s ± 1%     ~     (p=0.069 n=27+28)
      PutUint64-8              10.2GB/s ± 1%  10.2GB/s ± 0%   +0.15%  (p=0.039 n=27+27)
      LittleEndianPutUint16-8  3.50GB/s ± 1%  3.50GB/s ± 1%     ~     (p=0.552 n=30+29)
      LittleEndianPutUint32-8  7.01GB/s ± 1%  7.02GB/s ± 1%     ~     (p=0.160 n=29+27)
      LittleEndianPutUint64-8  14.0GB/s ± 1%  14.0GB/s ± 1%     ~     (p=0.413 n=29+29)
      PutUvarint32-8            174MB/s ± 1%   173MB/s ± 1%     ~     (p=0.648 n=25+30)
      PutUvarint64-8            139MB/s ± 2%   140MB/s ± 1%     ~     (p=0.271 n=30+26)
      [Geo mean]                906MB/s        911MB/s        +0.55%
      
      name                     old alloc/op   new alloc/op   delta
      ReadSlice1000Int32s-8      4.14kB ± 0%    4.13kB ± 0%   -0.19%  (p=0.000 n=30+30)
      ReadStruct-8                 200B ± 0%      200B ± 0%     ~     (all equal)
      ReadInts-8                  64.0B ± 0%     32.0B ± 0%  -50.00%  (p=0.000 n=30+30)
      WriteInts-8                  112B ± 0%       64B ± 0%  -42.86%  (p=0.000 n=30+30)
      WriteSlice1000Int32s-8     4.14kB ± 0%    4.13kB ± 0%   -0.19%  (p=0.000 n=30+30)
      PutUint16-8                 0.00B          0.00B          ~     (all equal)
      PutUint32-8                 0.00B          0.00B          ~     (all equal)
      PutUint64-8                 0.00B          0.00B          ~     (all equal)
      LittleEndianPutUint16-8     0.00B          0.00B          ~     (all equal)
      LittleEndianPutUint32-8     0.00B          0.00B          ~     (all equal)
      LittleEndianPutUint64-8     0.00B          0.00B          ~     (all equal)
      PutUvarint32-8              0.00B          0.00B          ~     (all equal)
      PutUvarint64-8              0.00B          0.00B          ~     (all equal)
      [Geo mean]                   476B           370B       -22.22%
      
      name                     old allocs/op  new allocs/op  delta
      ReadSlice1000Int32s-8        3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.000 n=30+30)
      ReadStruct-8                 16.0 ± 0%      16.0 ± 0%     ~     (all equal)
      ReadInts-8                   8.00 ± 0%      8.00 ± 0%     ~     (all equal)
      WriteInts-8                  14.0 ± 0%      14.0 ± 0%     ~     (all equal)
      WriteSlice1000Int32s-8       3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.000 n=30+30)
      PutUint16-8                  0.00           0.00          ~     (all equal)
      PutUint32-8                  0.00           0.00          ~     (all equal)
      PutUint64-8                  0.00           0.00          ~     (all equal)
      LittleEndianPutUint16-8      0.00           0.00          ~     (all equal)
      LittleEndianPutUint32-8      0.00           0.00          ~     (all equal)
      LittleEndianPutUint64-8      0.00           0.00          ~     (all equal)
      PutUvarint32-8               0.00           0.00          ~     (all equal)
      PutUvarint64-8               0.00           0.00          ~     (all equal)
      [Geo mean]                   6.94           5.90       -14.97%
      
      Change-Id: I3790b93e4190d98621d5f2c47e42929a18f56c2e
      Reviewed-on: https://go-review.googlesource.com/133135
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      2179e495
    • Agniva De Sarker's avatar
      misc/wasm: handle error during instantiateStreaming · e2e44a5d
      Agniva De Sarker authored
      The same catch block is there in wasm_exec.js for node processes.
      Added it in browser invocations too, to prevent uncaught exceptions.
      
      Change-Id: Icab577ec585fa86df3c76db508b49401bcdb52ae
      Reviewed-on: https://go-review.googlesource.com/132916Reviewed-by: default avatarRichard Musiol <neelance@gmail.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e2e44a5d
    • Leigh McCulloch's avatar
      go/types: correct misspelling in function doc · db3f52db
      Leigh McCulloch authored
      The indirectType function comment uses the phrase 'layed out'. In the
      context of that phrase, where something is being placed or sprawled,
      the word should be 'laid'. 'Layed' is a misspelling of 'laid'.
      
      Change-Id: I05ecb97637276e2252c47e92a0bd678130714889
      GitHub-Last-Rev: 6ee67371b42c12ceaf4c6c245319748008ac7e7b
      GitHub-Pull-Request: golang/go#27444
      Reviewed-on: https://go-review.googlesource.com/132779Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      db3f52db
  2. 03 Sep, 2018 7 commits
  3. 02 Sep, 2018 3 commits
    • Phil Pearl's avatar
      strings: simplify Join using Builder · 317afdc3
      Phil Pearl authored
      The existing implementation has a bunch of special cases and
      suffers an additional allocation for longer arrays. We can replace
      this code with a simple implementation using Builder, improve
      performance and reduce complexity.
      
      name      old time/op    new time/op    delta
      Join/0-8    3.53ns ± 3%    3.72ns ± 2%   +5.56%  (p=0.000 n=10+10)
      Join/1-8    3.94ns ± 4%    3.40ns ± 4%  -13.57%  (p=0.000 n=10+10)
      Join/2-8    57.0ns ± 3%    51.0ns ± 1%  -10.48%  (p=0.000 n=10+9)
      Join/3-8    74.9ns ± 2%    65.5ns ± 4%  -12.60%  (p=0.000 n=10+10)
      Join/4-8     105ns ± 0%      79ns ± 4%  -24.63%  (p=0.000 n=6+10)
      Join/5-8     116ns ± 2%      91ns ± 4%  -21.95%  (p=0.000 n=10+10)
      Join/6-8     131ns ± 1%     104ns ± 1%  -20.66%  (p=0.000 n=10+10)
      Join/7-8     141ns ± 0%     114ns ± 4%  -18.82%  (p=0.000 n=9+10)
      
      name      old alloc/op   new alloc/op   delta
      Join/0-8     0.00B          0.00B          ~     (all equal)
      Join/1-8     0.00B          0.00B          ~     (all equal)
      Join/2-8     16.0B ± 0%     16.0B ± 0%     ~     (all equal)
      Join/3-8     32.0B ± 0%     32.0B ± 0%     ~     (all equal)
      Join/4-8     96.0B ± 0%     48.0B ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/5-8     96.0B ± 0%     48.0B ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/6-8      128B ± 0%       64B ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/7-8      128B ± 0%       64B ± 0%  -50.00%  (p=0.000 n=10+10)
      
      name      old allocs/op  new allocs/op  delta
      Join/0-8      0.00           0.00          ~     (all equal)
      Join/1-8      0.00           0.00          ~     (all equal)
      Join/2-8      1.00 ± 0%      1.00 ± 0%     ~     (all equal)
      Join/3-8      1.00 ± 0%      1.00 ± 0%     ~     (all equal)
      Join/4-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/5-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/6-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      Join/7-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      
      Change-Id: I866a50e809c398512cb87648c955eaa4bf4d8606
      Reviewed-on: https://go-review.googlesource.com/132895Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      317afdc3
    • Giovanni Bajo's avatar
      cmd/compile: add testcase for #24876 · dd5e9b32
      Giovanni Bajo authored
      This is still not fixed, the testcase reflects that there are still
      a few boundchecks. Let's fix the good alternative with an explicit
      test though.
      
      Updates #24876
      
      Change-Id: I4da35eb353e19052bd7b69ea6190a69ced8b9b3d
      Reviewed-on: https://go-review.googlesource.com/107355Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Giovanni Bajo <rasky@develer.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      dd5e9b32
    • Giovanni Bajo's avatar
      test: relax whitespaces matching in codegen tests · f02cc88f
      Giovanni Bajo authored
      The codegen testsuite uses regexp to parse the syntax, but it doesn't
      have a way to tell line comments containing checks from line comments
      containing English sentences. This means that any syntax error (that
      is, non-matching regexp) is currently ignored and not reported.
      
      There were some tests in memcombine.go that had an extraneous space
      and were thus effectively disabled. It would be great if we could
      report it as a syntax error, but for now we just punt and swallow the
      spaces as a workaround, to avoid the same mistake again.
      
      Fixes #25452
      
      Change-Id: Ic7747a2278bc00adffd0c199ce40937acbbc9cf0
      Reviewed-on: https://go-review.googlesource.com/113835
      Run-TryBot: Giovanni Bajo <rasky@develer.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      f02cc88f
  4. 01 Sep, 2018 2 commits
  5. 31 Aug, 2018 11 commits
  6. 30 Aug, 2018 13 commits