1. 25 Mar, 2019 5 commits
  2. 24 Mar, 2019 3 commits
    • sergey's avatar
      net/url: check for lowercase before uppercase in shouldEscape · c7bb4533
      sergey authored
      Most chars in URLs are lowercase, so check that first.
      
      Performance change:
      
      String-4               7.62µs ± 1%    7.27µs ± 3%  -4.61%  (p=0.008 n=5+5)
      QueryEscape/#00-4      92.6ns ± 3%    90.3ns ± 1%  -2.48%  (p=0.016 n=5+5)
      QueryEscape/#01-4       515ns ± 4%     510ns ± 2%    ~     (p=0.683 n=5+5)
      QueryEscape/#02-4       375ns ± 1%     343ns ± 1%  -8.52%  (p=0.008 n=5+5)
      QueryEscape/#03-4       758ns ± 1%     699ns ± 1%  -7.83%  (p=0.008 n=5+5)
      QueryEscape/#04-4      6.06µs ± 1%    5.74µs ± 1%  -5.38%  (p=0.008 n=5+5)
      PathEscape/#00-4        140ns ± 1%     135ns ± 2%  -3.85%  (p=0.008 n=5+5)
      PathEscape/#01-4        511ns ± 3%     507ns ± 3%    ~     (p=0.587 n=5+5)
      PathEscape/#02-4        372ns ± 1%     342ns ± 2%  -8.22%  (p=0.008 n=5+5)
      PathEscape/#03-4        747ns ± 1%     685ns ± 1%  -8.30%  (p=0.008 n=5+5)
      PathEscape/#04-4       5.94µs ± 1%    5.64µs ± 3%  -4.98%  (p=0.008 n=5+5)
      QueryUnescape/#00-4     111ns ± 4%     110ns ± 2%    ~     (p=0.952 n=5+5)
      QueryUnescape/#01-4     390ns ± 0%     391ns ± 2%    ~     (p=0.714 n=5+5)
      QueryUnescape/#02-4     297ns ± 5%     295ns ± 3%    ~     (p=0.524 n=5+5)
      QueryUnescape/#03-4     543ns ± 3%     556ns ± 2%  +2.39%  (p=0.032 n=5+5)
      QueryUnescape/#04-4    3.23µs ± 3%    3.22µs ± 2%    ~     (p=1.000 n=5+5)
      PathUnescape/#00-4      111ns ± 1%     110ns ± 3%    ~     (p=0.881 n=5+5)
      PathUnescape/#01-4      389ns ± 2%     386ns ± 2%    ~     (p=0.444 n=5+5)
      PathUnescape/#02-4      297ns ± 1%     295ns ± 3%    ~     (p=0.738 n=5+5)
      PathUnescape/#03-4      557ns ± 3%     553ns ± 2%    ~     (p=0.810 n=5+5)
      PathUnescape/#04-4     2.94µs ± 2%    2.97µs ± 2%    ~     (p=0.222 n=5+5)
      
      Change-Id: I7e6d64cd5f8f5218cb40f52f0015168a8674aabb
      Reviewed-on: https://go-review.googlesource.com/c/go/+/168883Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      c7bb4533
    • Alex Brainman's avatar
      cmd/go: keep WINDIR during TestScript · 7722f6d2
      Alex Brainman authored
      TestScript executes PowerShell. And PowerShell appears to require
      WINDIR environment variable to exists on windows-arm.
      
      So keep WINDIR environment variable when running PowerShell.
      
      Fixes #30711
      
      Change-Id: I14dde6614347325a8f3caf994ea8ab05294450a5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/168859
      Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7722f6d2
    • Daniel Martí's avatar
      text/template: allow using -}} with many spaces · e770b5b3
      Daniel Martí authored
      lexSpace consumed all spaces, even if the last one was part of a right
      delimiter like " -}}". Thus, "3  -}}" wouldn't lex as "3" and a right
      delimiter, but as "3", "-", and "}}".
      
      To fix that, make lexSpace stop if it encounters a right delimiter.
      
      Fixes #30948.
      
      Change-Id: I80a5546e5809e54f6823e2bf3a57a7e8808329be
      Reviewed-on: https://go-review.googlesource.com/c/go/+/168457Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
      e770b5b3
  3. 23 Mar, 2019 3 commits
  4. 22 Mar, 2019 14 commits
  5. 21 Mar, 2019 14 commits
  6. 20 Mar, 2019 1 commit
    • Josh Bleecher Snyder's avatar
      testing: stop rounding b.N · 03a79e94
      Josh Bleecher Snyder authored
      The original goal of rounding to readable b.N
      was to make it easier to eyeball times.
      However, proper analysis requires tooling
      (such as benchstat) anyway.
      
      Instead, take b.N as it comes.
      This will reduce the impact of external noise
      such as GC on benchmarks.
      
      This requires reworking our iteration estimates.
      We used to calculate the estimated ns/op
      and then divide our target ns by that estimate.
      However, this order of operations was destructive
      when the ns/op was very small; rounding could
      hide almost an order of magnitude of variation.
      Instead, multiply first, then divide.
      Also, make n an int64 to avoid overflow.
      
      Prior to this change, we attempted to cap b.N at 1e9.
      Due to rounding up, it was possible to get b.N as high as 2e9.
      This change consistently enforces the 1e9 cap.
      
      This change also reduces the wall time required to run benchmarks.
      
      Here's the impact of this change on the wall time to run
      all benchmarks once with benchtime=1s on some std packages:
      
      name           old time/op       new time/op       delta
      bytes                 306s ± 1%         238s ± 1%  -22.24%  (p=0.000 n=10+10)
      encoding/json         112s ± 8%          99s ± 7%  -11.64%  (p=0.000 n=10+10)
      net/http             54.7s ± 7%        44.9s ± 4%  -17.94%  (p=0.000 n=10+9)
      runtime               957s ± 1%         714s ± 0%  -25.38%  (p=0.000 n=10+9)
      strings               262s ± 1%         201s ± 1%  -23.27%  (p=0.000 n=10+10)
      [Geo mean]            216s              172s       -20.23%
      
      Updates #24735
      
      Change-Id: I7e38efb8e23c804046bf4fc065b3f5f3991d0a15
      Reviewed-on: https://go-review.googlesource.com/c/go/+/112155Reviewed-by: default avatarAustin Clements <austin@google.com>
      03a79e94