1. 03 May, 2018 11 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile: optimize a - b == 0 into a == b · 4a1baf8b
      Josh Bleecher Snyder authored
      These rules trigger 1141 times during make.bash.
      
      Shrinks a few object files a tiny bit:
      
      name        old object-bytes  new object-bytes  delta
      Template          476kB ± 0%        476kB ± 0%  +0.00%  (p=0.008 n=5+5)
      Unicode           218kB ± 0%        218kB ± 0%    ~     (all equal)
      GoTypes          1.58MB ± 0%       1.58MB ± 0%    ~     (all equal)
      Compiler         6.25MB ± 0%       6.25MB ± 0%  -0.00%  (p=0.008 n=5+5)
      Flate             304kB ± 0%        304kB ± 0%  -0.01%  (p=0.008 n=5+5)
      GoParser          370kB ± 0%        370kB ± 0%    ~     (all equal)
      Reflect          1.27MB ± 0%       1.27MB ± 0%    ~     (all equal)
      Tar               421kB ± 0%        421kB ± 0%  -0.05%  (p=0.008 n=5+5)
      XML               518kB ± 0%        518kB ± 0%    ~     (all equal)
      
      archive/tar benchmarks:
      
      name             old time/op    new time/op    delta
      /Writer/USTAR-8    3.97µs ± 1%    3.88µs ± 0%  -2.26%  (p=0.000 n=26+26)
      /Writer/GNU-8      4.67µs ± 0%    4.54µs ± 1%  -2.72%  (p=0.000 n=28+27)
      /Writer/PAX-8      8.20µs ± 0%    8.01µs ± 0%  -2.32%  (p=0.000 n=29+29)
      /Reader/USTAR-8    3.61µs ± 0%    3.54µs ± 1%  -2.04%  (p=0.000 n=25+28)
      /Reader/GNU-8      2.27µs ± 2%    2.17µs ± 0%  -4.08%  (p=0.000 n=30+28)
      /Reader/PAX-8      7.75µs ± 0%    7.63µs ± 0%  -1.60%  (p=0.000 n=28+28)
      [Geo mean]         4.61µs         4.50µs       -2.51%
      
      Change-Id: Ib4dfade5069a7463ccaba073ea91c8213e9714a0
      Reviewed-on: https://go-review.googlesource.com/110235
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIlya Tocar <ilya.tocar@intel.com>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      4a1baf8b
    • Ben Shi's avatar
      cmd/internal/obj/arm64: add more atomic instructions · fc48dcb1
      Ben Shi authored
      More atomic instructions were introduced in ARMv8.1. And this CL
      adds support for them and corresponding test cases.
      
      LDADD Rs, (Rb), Rt: (Rb) -> Rt, Rs+(Rb) -> (Rb)
      LDAND Rs, (Rb), Rt: (Rb) -> Rt, Rs&(Rb) -> (Rb)
      LDEOR Rs, (Rb), Rt: (Rb) -> Rt, Rs^(Rb) -> (Rb)
      LDOR  Rs, (Rb), Rt: (Rb) -> Rt, Rs|(Rb) -> (Rb)
      
      Change-Id: Ifb9df86583c4dc54fb96274852c3b93a197045e4
      Reviewed-on: https://go-review.googlesource.com/110535Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      fc48dcb1
    • Marvin Stenger's avatar
      strconv: simplify and optimize Itoa(small) · 3c0bf181
      Marvin Stenger authored
      Use substring of digits for values < 10.
      
      name                 old time/op  new time/op  delta
      FormatIntSmall/7-4   4.54ns ± 1%  3.70ns ± 1%  -18.41%  (p=0.000 n=18+17)
      FormatIntSmall/42-4  4.54ns ± 1%  4.13ns ± 1%   -9.02%  (p=0.000 n=16+18)
      
      Change-Id: I0b521b563c13ef88aa2701049fa4a43760e884af
      Reviewed-on: https://go-review.googlesource.com/111285Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3c0bf181
    • Richard Musiol's avatar
      crypto/rand, crypto/x509: add js/wasm architecture · 63756e0c
      Richard Musiol authored
      This commit adds the js/wasm architecture to the crypto packages.
      
      Updates #18892
      
      Change-Id: Id41a9d54920746d5019cbeedcff1b83874f2ef73
      Reviewed-on: https://go-review.googlesource.com/110095Reviewed-by: 's avatarAustin Clements <austin@google.com>
      63756e0c
    • Richard Musiol's avatar
      syscall/js: add package · 7b836368
      Richard Musiol authored
      This commit adds the syscall/js package, which is used by the wasm
      architecture to access the WebAssembly host environment (and the
      operating system through it). Currently, web browsers and Node.js
      are supported hosts, which is why the API is based on JavaScript APIs.
      There is no common API standardized in the WebAssembly ecosystem yet.
      
      This package is experimental. Its current scope is only to allow
      tests to run, but not yet to provide a comprehensive API for users.
      
      Updates #18892
      
      Change-Id: I236ea10a70d95cdd50562212f2c18c3db5009230
      Reviewed-on: https://go-review.googlesource.com/109195Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      7b836368
    • Josh Bleecher Snyder's avatar
      cmd/compile: shrink liveness maps · 1e27e480
      Josh Bleecher Snyder authored
      The GC maps don't care about trailing non-pointers in args.
      Work harder to eliminate them.
      
      This should provide a slight speedup to everything that reads these
      maps, mainly GC and stack copying.
      
      The non-ptr-y runtime benchmarks happen to go from having a non-empty
      args map to an empty args map, so they have a significant speedup.
      
      name                old time/op  new time/op  delta
      StackCopyPtr-8      80.2ms ± 4%  79.7ms ± 2%  -0.63%  (p=0.001 n=94+91)
      StackCopy-8         63.3ms ± 3%  59.2ms ± 3%  -6.45%  (p=0.000 n=98+97)
      StackCopyNoCache-8   107ms ± 3%    98ms ± 3%  -8.00%  (p=0.000 n=95+88)
      
      It also shrinks object files a tiny bit:
      
      name        old object-bytes  new object-bytes  delta
      Template          476kB ± 0%        476kB ± 0%  -0.03%  (p=0.008 n=5+5)
      Unicode           218kB ± 0%        218kB ± 0%  -0.09%  (p=0.008 n=5+5)
      GoTypes          1.58MB ± 0%       1.58MB ± 0%  -0.03%  (p=0.008 n=5+5)
      Compiler         6.25MB ± 0%       6.24MB ± 0%  -0.06%  (p=0.008 n=5+5)
      SSA              15.9MB ± 0%       15.9MB ± 0%  -0.06%  (p=0.008 n=5+5)
      Flate             304kB ± 0%        303kB ± 0%  -0.29%  (p=0.008 n=5+5)
      GoParser          370kB ± 0%        370kB ± 0%  +0.02%  (p=0.008 n=5+5)
      Reflect          1.27MB ± 0%       1.27MB ± 0%  -0.07%  (p=0.008 n=5+5)
      Tar               421kB ± 0%        421kB ± 0%  -0.05%  (p=0.008 n=5+5)
      XML               518kB ± 0%        517kB ± 0%  -0.06%  (p=0.008 n=5+5)
      [Geo mean]        934kB             933kB       -0.07%
      
      Note that some object files do grow;
      this can happen because some maps that were
      duplicates of each others must be stored separately.
      
      Change-Id: Ie076891bd8e9d269ff2ff5435d5d25c721e0e31d
      Reviewed-on: https://go-review.googlesource.com/104175
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      1e27e480
    • Josh Bleecher Snyder's avatar
      runtime: convert g.waitreason from string to uint8 · 4d7cf3fe
      Josh Bleecher Snyder authored
      Every time I poke at #14921, the g.waitreason string
      pointer writes show up.
      
      They're not particularly important performance-wise,
      but it'd be nice to clear the noise away.
      
      And it does open up a few extra bytes in the g struct
      for some future use.
      
      This is a re-roll of CL 99078, which was rolled
      back because of failures on s390x.
      Those failures were apparently due to an old version of gdb.
      
      Change-Id: Icc2c12f449b2934063fd61e272e06237625ed589
      Reviewed-on: https://go-review.googlesource.com/111256
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMichael Munday <mike.munday@ibm.com>
      4d7cf3fe
    • Elias Naur's avatar
      misc/ios: retry lldb launch if the iOS app is busy · 4704149e
      Elias Naur authored
      Sometimes, a newly installed the test app is not ready to launch
      or the reported app path is stale. Pause and retry the launch if
      the lldb script did not run the program.
      
      Change-Id: Ic7745d4b5a02f2e3cb8134341859039812f65a65
      Reviewed-on: https://go-review.googlesource.com/111216
      Run-TryBot: Elias Naur <elias.naur@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      4704149e
    • Elias Naur's avatar
      misc/ios: clean up debugger instance on failure · 64f715be
      Elias Naur authored
      Also replace repeated `or` clauses with the Python idiomatic list
      operator `in`.
      
      Change-Id: I4b178f93eb92996d8b5449ee5d252543624aed9e
      Reviewed-on: https://go-review.googlesource.com/111215
      Run-TryBot: Elias Naur <elias.naur@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      64f715be
    • Elias Naur's avatar
      misc/ios: ensure deferred cleanup functions are run even on error · 8b9ecbf3
      Elias Naur authored
      log.Fatal exits the process and doesn't allow deferred functions
      to run. Extract log.Fatal calls to main where all deferred functions
      have completed.
      
      For the iOS builder.
      
      Change-Id: Id1ef9955bed19944a819d6137a611d6ecbe624a6
      Reviewed-on: https://go-review.googlesource.com/110955
      Run-TryBot: Elias Naur <elias.naur@gmail.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      8b9ecbf3
    • Elias Naur's avatar
      misc/ios: retry app install · 78cb5d7a
      Elias Naur authored
      Sometimes ideviceinstaller fails to install the app. Retry a few
      times before giving up.
      
      For the iOS builder.
      
      Change-Id: Ib066ffd4f97ae8d22c0fa9a78ea4d04f67c17410
      Reviewed-on: https://go-review.googlesource.com/111055
      Run-TryBot: Elias Naur <elias.naur@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      78cb5d7a
  2. 02 May, 2018 12 commits
  3. 01 May, 2018 17 commits