1. 06 Mar, 2019 4 commits
  2. 05 Mar, 2019 25 commits
  3. 04 Mar, 2019 11 commits
    • Emmanuel T Odeke's avatar
      testing: fix missing verb in StartTimer doc · 6b045508
      Emmanuel T Odeke authored
      Fixes StartTimer's doc with the verb 'be'
      that was previously missing in 'can also used'.
      
      Change-Id: I4b3e6103fbf62d676056d32fcce4618536b7c05c
      Reviewed-on: https://go-review.googlesource.com/c/go/+/165117Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      6b045508
    • Rémy Oudompheng's avatar
      strconv: simplify (*extFloat).Multiply using math/bits.Mul64 · a1f7dbf0
      Rémy Oudompheng authored
      This method was using a handwritten long multiplication of uint64s.
      Since implementation of #24813 we can remove it and replace it
      by Mul64 from math/bits.
      
      This brings a small speedup for 64-bit platforms.
      
      Benchmarks on Haswell Celeron 2955U.
      
      benchmark                                  old ns/op     new ns/op     delta
      BenchmarkAppendFloat/Decimal-2             127           127           +0.00%
      BenchmarkAppendFloat/Float-2               340           317           -6.76%
      BenchmarkAppendFloat/Exp-2                 258           233           -9.69%
      BenchmarkAppendFloat/NegExp-2              256           231           -9.77%
      BenchmarkAppendFloat/Big-2                 402           375           -6.72%
      BenchmarkAppendFloat/BinaryExp-2           113           114           +0.88%
      BenchmarkAppendFloat/32Integer-2           125           125           +0.00%
      BenchmarkAppendFloat/32ExactFraction-2     274           249           -9.12%
      BenchmarkAppendFloat/32Point-2             339           317           -6.49%
      BenchmarkAppendFloat/32Exp-2               255           229           -10.20%
      BenchmarkAppendFloat/32NegExp-2            254           229           -9.84%
      BenchmarkAppendFloat/64Fixed1-2            165           154           -6.67%
      BenchmarkAppendFloat/64Fixed2-2            184           176           -4.35%
      BenchmarkAppendFloat/64Fixed3-2            168           158           -5.95%
      BenchmarkAppendFloat/64Fixed4-2            187           177           -5.35%
      BenchmarkAppendFloat/Slowpath64-2          84977         84883         -0.11%
      
      Change-Id: If05784e856289b3b7bf136567882e7ee10234756
      Reviewed-on: https://go-review.googlesource.com/c/go/+/157717
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      a1f7dbf0
    • Josh Bleecher Snyder's avatar
      math/big: rewrite pure Go implementations to use math/bits · d5edbcac
      Josh Bleecher Snyder authored
      While we're here, delete addWW_g and subWW_g, per the TODO.
      They are now obsolete.
      
      Benchmarks on amd64 with -tags=math_big_pure_go.
      
      name                old time/op    new time/op     delta
      AddVV/1-8             5.24ns ± 2%     5.12ns ± 1%    -2.11%  (p=0.000 n=82+87)
      AddVV/2-8             6.44ns ± 1%     6.33ns ± 2%    -1.82%  (p=0.000 n=77+82)
      AddVV/3-8             7.89ns ± 8%     6.97ns ± 4%   -11.71%  (p=0.000 n=100+96)
      AddVV/4-8             8.60ns ± 0%     7.72ns ± 4%   -10.24%  (p=0.000 n=90+96)
      AddVV/5-8             10.3ns ± 4%      8.5ns ± 1%   -17.02%  (p=0.000 n=96+91)
      AddVV/10-8            16.2ns ± 5%     12.8ns ± 1%   -21.11%  (p=0.000 n=97+86)
      AddVV/100-8            148ns ± 1%      117ns ± 5%   -21.07%  (p=0.000 n=66+98)
      AddVV/1000-8          1.41µs ± 4%     1.13µs ± 3%   -19.90%  (p=0.000 n=97+97)
      AddVV/10000-8         14.2µs ± 5%     11.2µs ± 1%   -20.82%  (p=0.000 n=99+84)
      AddVV/100000-8         142µs ± 4%      113µs ± 4%   -20.40%  (p=0.000 n=91+92)
      SubVV/1-8             5.29ns ± 1%     5.11ns ± 0%    -3.30%  (p=0.000 n=87+88)
      SubVV/2-8             6.36ns ± 4%     6.33ns ± 2%    -0.56%  (p=0.002 n=98+73)
      SubVV/3-8             7.58ns ± 5%     6.98ns ± 4%    -8.01%  (p=0.000 n=97+91)
      SubVV/4-8             8.61ns ± 3%     7.98ns ± 2%    -7.31%  (p=0.000 n=95+83)
      SubVV/5-8             10.6ns ± 2%      8.5ns ± 1%   -19.56%  (p=0.000 n=79+89)
      SubVV/10-8            16.3ns ± 4%     12.7ns ± 1%   -21.97%  (p=0.000 n=98+82)
      SubVV/100-8            124ns ± 1%      118ns ± 1%    -4.83%  (p=0.000 n=85+81)
      SubVV/1000-8          1.14µs ± 5%     1.12µs ± 2%    -1.17%  (p=0.000 n=97+81)
      SubVV/10000-8         11.6µs ±10%     11.2µs ± 1%    -3.39%  (p=0.000 n=100+84)
      SubVV/100000-8         114µs ± 6%      114µs ± 5%      ~     (p=0.396 n=83+94)
      AddVW/1-8             4.04ns ± 4%     4.34ns ± 4%    +7.57%  (p=0.000 n=96+98)
      AddVW/2-8             4.34ns ± 5%     4.40ns ± 5%    +1.40%  (p=0.000 n=99+98)
      AddVW/3-8             5.43ns ± 0%     5.54ns ± 2%    +1.97%  (p=0.000 n=85+94)
      AddVW/4-8             6.23ns ± 1%     6.18ns ± 2%    -0.66%  (p=0.000 n=77+78)
      AddVW/5-8             6.78ns ± 2%     6.90ns ± 4%    +1.77%  (p=0.000 n=80+99)
      AddVW/10-8            10.5ns ± 4%      9.9ns ± 1%    -5.77%  (p=0.000 n=97+69)
      AddVW/100-8            114ns ± 3%       91ns ± 0%   -20.38%  (p=0.000 n=98+77)
      AddVW/1000-8          1.12µs ± 1%     0.87µs ± 1%   -22.80%  (p=0.000 n=82+68)
      AddVW/10000-8         11.2µs ± 2%      8.5µs ± 5%   -23.85%  (p=0.000 n=85+100)
      AddVW/100000-8         112µs ± 2%       85µs ± 5%   -24.22%  (p=0.000 n=71+96)
      SubVW/1-8             4.09ns ± 2%     4.18ns ± 4%    +2.32%  (p=0.000 n=78+96)
      SubVW/2-8             4.59ns ± 5%     4.52ns ± 7%    -1.54%  (p=0.000 n=98+94)
      SubVW/3-8             5.41ns ±10%     5.55ns ± 1%    +2.48%  (p=0.000 n=100+89)
      SubVW/4-8             6.51ns ± 2%     6.19ns ± 0%    -4.85%  (p=0.000 n=97+81)
      SubVW/5-8             7.25ns ± 3%     6.90ns ± 4%    -4.93%  (p=0.000 n=97+96)
      SubVW/10-8            10.6ns ± 4%      9.8ns ± 2%    -7.32%  (p=0.000 n=95+96)
      SubVW/100-8           90.4ns ± 0%     90.8ns ± 0%    +0.43%  (p=0.000 n=83+78)
      SubVW/1000-8           853ns ± 4%      857ns ± 2%    +0.42%  (p=0.000 n=100+98)
      SubVW/10000-8         8.52µs ± 4%     8.53µs ± 2%      ~     (p=0.061 n=99+97)
      SubVW/100000-8        84.8µs ± 5%     84.2µs ± 2%    -0.78%  (p=0.000 n=99+93)
      AddMulVVW/1-8         8.73ns ± 0%     5.33ns ± 3%   -38.91%  (p=0.000 n=91+96)
      AddMulVVW/2-8         14.8ns ± 3%      6.5ns ± 2%   -56.33%  (p=0.000 n=100+79)
      AddMulVVW/3-8         18.6ns ± 2%      7.8ns ± 5%   -57.84%  (p=0.000 n=89+96)
      AddMulVVW/4-8         24.0ns ± 2%      9.8ns ± 0%   -59.09%  (p=0.000 n=95+67)
      AddMulVVW/5-8         29.0ns ± 2%     11.5ns ± 5%   -60.44%  (p=0.000 n=90+97)
      AddMulVVW/10-8        54.1ns ± 0%     18.8ns ± 1%   -65.37%  (p=0.000 n=82+84)
      AddMulVVW/100-8        508ns ± 2%      165ns ± 4%   -67.62%  (p=0.000 n=72+98)
      AddMulVVW/1000-8      4.96µs ± 3%     1.55µs ± 1%   -68.86%  (p=0.000 n=99+91)
      AddMulVVW/10000-8     50.0µs ± 4%     15.5µs ± 4%   -68.95%  (p=0.000 n=97+97)
      AddMulVVW/100000-8     491µs ± 1%      156µs ± 8%   -68.22%  (p=0.000 n=79+95)
      
      Change-Id: I4c6ae0b4065f371aea8103f6a85d9e9274bf01d0
      Reviewed-on: https://go-review.googlesource.com/c/go/+/164965
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      d5edbcac
    • Baokun Lee's avatar
      os: remove unreadable directories in RemoveAll · c7465929
      Baokun Lee authored
      Fixes #30555
      
      Change-Id: Ib894b4f3cdba23a18a69c9470cf69ceb83591a4d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/165057
      Run-TryBot: Baokun Lee <nototon@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      c7465929
    • Josh Bleecher Snyder's avatar
      math/big: optimize shlVU_g and shrVU_g · 87cc5671
      Josh Bleecher Snyder authored
      Special case shifts by zero.
      Provide hints to the compiler that shifts are bounded.
      
      There are no existing benchmarks for shifts,
      but the Float implementation uses shifts,
      so we can use those.
      
      Benchmarks on amd64 with -tags=math_big_pure_go.
      
      name                  old time/op    new time/op    delta
      FloatString/100-8        869ns ± 3%     872ns ± 4%   +0.40%  (p=0.001 n=94+83)
      FloatString/1000-8      26.5µs ± 1%    26.4µs ± 1%   -0.46%  (p=0.000 n=87+96)
      FloatString/10000-8     2.18ms ± 2%    2.18ms ± 2%     ~     (p=0.687 n=90+89)
      FloatString/100000-8     200ms ± 7%     197ms ± 5%   -1.47%  (p=0.000 n=100+90)
      FloatAdd/10-8           65.9ns ± 4%    64.0ns ± 4%   -2.94%  (p=0.000 n=92+93)
      FloatAdd/100-8          71.3ns ± 4%    67.4ns ± 4%   -5.51%  (p=0.000 n=96+93)
      FloatAdd/1000-8          128ns ± 1%     121ns ± 0%   -5.69%  (p=0.000 n=91+80)
      FloatAdd/10000-8         718ns ± 4%     626ns ± 4%  -12.83%  (p=0.000 n=99+99)
      FloatAdd/100000-8       6.43µs ± 3%    5.50µs ± 1%  -14.50%  (p=0.000 n=98+83)
      FloatSub/10-8           57.7ns ± 2%    57.0ns ± 4%   -1.20%  (p=0.000 n=89+96)
      FloatSub/100-8          59.9ns ± 3%    58.7ns ± 4%   -2.10%  (p=0.000 n=100+98)
      FloatSub/1000-8         94.5ns ± 1%    88.6ns ± 0%   -6.16%  (p=0.000 n=74+70)
      FloatSub/10000-8         456ns ± 1%     416ns ± 5%   -8.83%  (p=0.000 n=87+95)
      FloatSub/100000-8       4.00µs ± 1%    3.57µs ± 1%  -10.87%  (p=0.000 n=68+85)
      FloatSqrt/64-8           585ns ± 1%     579ns ± 1%   -0.99%  (p=0.000 n=92+90)
      FloatSqrt/128-8         1.26µs ± 1%    1.23µs ± 2%   -2.42%  (p=0.000 n=91+81)
      FloatSqrt/256-8         1.45µs ± 3%    1.40µs ± 1%   -3.61%  (p=0.000 n=96+90)
      FloatSqrt/1000-8        4.03µs ± 1%    3.91µs ± 1%   -3.05%  (p=0.000 n=90+93)
      FloatSqrt/10000-8       48.0µs ± 0%    47.3µs ± 1%   -1.55%  (p=0.000 n=90+90)
      FloatSqrt/100000-8      1.23ms ± 3%    1.22ms ± 4%   -1.00%  (p=0.000 n=99+99)
      FloatSqrt/1000000-8     96.7ms ± 4%    98.0ms ±10%     ~     (p=0.322 n=89+99)
      
      Change-Id: I0f941c05b7c324256d7f0674559b6ba906e92ba8
      Reviewed-on: https://go-review.googlesource.com/c/go/+/164967
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      87cc5671
    • Michael Anthony Knyszek's avatar
      runtime: use MADV_FREE_REUSABLE on darwin · abf8e355
      Michael Anthony Knyszek authored
      Currently on darwin we use MADV_FREE, which unfortunately doesn't result
      in a change in the process's RSS until pages actually get kicked out,
      which the OS is free to do lazily (e.g. until it finds itself under
      memory pressure).
      
      To remedy this, we instead use MADV_FREE_REUSABLE which has similar
      semantics, except that it also sets a reusable bit on each page so the
      process's RSS gets reported more accurately. The one caveat is for every
      time we call MADV_FREE_REUSABLE on a region we must call MADV_FREE_REUSE
      to keep the kernel's accounting updated.
      
      Also, because this change requires adding new constants that only exist
      on darwin, it splits mem_bsd.go into mem_bsd.go and mem_darwin.go.
      
      Fixes #29844.
      
      Change-Id: Idb6421698511138a430807bcbbd1516cd57557c8
      Reviewed-on: https://go-review.googlesource.com/c/go/+/159117Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Michael Knyszek <mknyszek@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      abf8e355
    • Agniva De Sarker's avatar
      misc/git: remove pre-commit file · 0c7cdb49
      Agniva De Sarker authored
      All hook files are automatically set up when any git-codereview command is run.
      And since the contribution guidelines point to installing git-codereview,
      this file does not serve any purpose any more.
      
      Change-Id: I165f6905ca03fd3d512c59e2654ef79e76de934c
      Reviewed-on: https://go-review.googlesource.com/c/go/+/158677Reviewed-by: default avatarAndrew Bonventre <andybons@golang.org>
      0c7cdb49
    • Carrie Bynon's avatar
      doc: make path platform dependent · 88da9ccb
      Carrie Bynon authored
      Path should now appear with the correct slash, depending on which
      platform install document is being viewed - keeping in line with the
      rest of the document.
      
      Fixes #30160
      
      Change-Id: Ib10e5a4adf366c700bff6f8d246bd5e3111ed61c
      Reviewed-on: https://go-review.googlesource.com/c/go/+/162918Reviewed-by: default avatarAndrew Bonventre <andybons@golang.org>
      88da9ccb
    • Baokun Lee's avatar
      cmd/api: fix no go files package panic · 68eb3ccd
      Baokun Lee authored
      Fixes #29837
      
      Change-Id: I7d57c24d2133932c076df6f41dd6589f777b65dd
      Reviewed-on: https://go-review.googlesource.com/c/158877
      Run-TryBot: Baokun Lee <nototon@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      68eb3ccd
    • Daniel Martí's avatar
      os/exec: less allocs in the common case · d1887676
      Daniel Martí authored
      When Stdin, Stdout, and Stderr are nil, there are no goroutines to keep
      track of, so we don't need a channel.
      
      And in startProcess, preallocate the right size for sysattr.Files,
      saving a bit of space and a couple of slice growth allocs.
      
      name            old time/op    new time/op    delta
      ExecHostname-8     419µs ± 0%     417µs ± 1%    ~     (p=0.093 n=6+6)
      
      name            old alloc/op   new alloc/op   delta
      ExecHostname-8    6.40kB ± 0%    6.28kB ± 0%  -1.86%  (p=0.002 n=6+6)
      
      name            old allocs/op  new allocs/op  delta
      ExecHostname-8      34.0 ± 0%      31.0 ± 0%  -8.82%  (p=0.002 n=6+6)
      
      Change-Id: Ic1d617f29e9c6431cdcadc7f9bb992750a6d5f48
      Reviewed-on: https://go-review.googlesource.com/c/164801
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d1887676
    • Brian Kessler's avatar
      encoding/csv: document that Writer is buffered · 0db5534d
      Brian Kessler authored
      Add documentation that individual Write calls are buffered and
      copy documentation from bufio.Writer notifying the user to call
      Flush and Error when all writes are complete. Remove reference
      to "file" since the implementation is general and allows any
      io.Writer.
      
      Fixes #30045
      
      Change-Id: I50165470e548f296494e764707fbabe36c665015
      Reviewed-on: https://go-review.googlesource.com/c/160680Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      0db5534d