1. 25 Mar, 2016 12 commits
  2. 24 Mar, 2016 20 commits
  3. 23 Mar, 2016 8 commits
    • Brad Fitzpatrick's avatar
      net/http/httptest: add NewRequest helper for ease of testing handlers · 694eadcc
      Brad Fitzpatrick authored
      Fixes #14199
      
      Change-Id: Ic9284023b663de3db1ca7b7b1e96eeab82ec0944
      Reviewed-on: https://go-review.googlesource.com/21016
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      694eadcc
    • Marvin Stenger's avatar
      cmd/compile: prettify loop iterations · bd83cc6d
      Marvin Stenger authored
      This commit replaces some of
      
      for i := len(x) - 1; i >= 0; i-- {...}
      
      style loops, which do not rely on reverse iteration order.
      
      Change-Id: I5542834286562da058200c06e7a173b13760e54d
      Reviewed-on: https://go-review.googlesource.com/21044Reviewed-by: default avatarKeith Randall <khr@golang.org>
      bd83cc6d
    • Brad Fitzpatrick's avatar
      cmd/compile: reduce some SSA garbage · ca5417b8
      Brad Fitzpatrick authored
      It's pretty hard to get reliable CPU numbers, even with 50 runs on an
      otherwise-idle physical Linux machine, but the garbage reduction
      numbers are nice. To get useful time/op numbers, I modified
      compilebench to report user CPU time instead of wall time:
      
      name       old time/op     new time/op     delta
      Template       547ms ± 6%      557ms ± 5%   +1.80%        (p=0.001 n=49+49)
      Unicode        360ms ± 9%      365ms ± 6%     ~           (p=0.094 n=50+45)
      GoTypes        1.84s ± 3%      1.82s ± 3%   -1.50%        (p=0.000 n=50+49)
      Compiler       9.19s ± 2%      9.02s ± 2%   -1.87%        (p=0.000 n=45+50)
      
      name       old alloc/op    new alloc/op    delta
      Template      63.3MB ± 0%     59.1MB ± 0%   -6.72%        (p=0.000 n=50+50)
      Unicode       43.1MB ± 0%     42.9MB ± 0%   -0.47%        (p=0.000 n=50+49)
      GoTypes        220MB ± 0%      200MB ± 0%   -9.00%        (p=0.000 n=50+50)
      Compiler      1.00GB ± 0%     0.89GB ± 0%  -10.09%        (p=0.000 n=50+49)
      
      name       old allocs/op   new allocs/op   delta
      Template        681k ± 0%       680k ± 0%   -0.16%        (p=0.000 n=50+48)
      Unicode         541k ± 0%       541k ± 0%   -0.02%        (p=0.011 n=48+50)
      GoTypes        2.08M ± 0%      2.08M ± 0%   -0.19%        (p=0.000 n=48+50)
      Compiler       9.24M ± 0%      9.23M ± 0%   -0.11%        (p=0.000 n=50+50)
      
      Change-Id: I1fac4ebf85a1783e3289c3ffb1ed365442837643
      Reviewed-on: https://go-review.googlesource.com/20995
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDave Cheney <dave@cheney.net>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      ca5417b8
    • Matthew Dempsky's avatar
      cmd/compile: small Mpint method simplifications · 0659cf69
      Matthew Dempsky authored
      Get rid of (*Mpint).Add's "quiet" parameter: it's always set to 0.
      
      Inline (*Mpint).shift into (*Mpint).Lsh and (*Mpint).Rsh. There's no
      need for a common shift method that can handle both left or right
      shifts based on sign when the higher level abstractions only ever do
      one or the other.
      
      Change-Id: Icd3b082413f9193961b6835279e0bd4b6a6a6621
      Reviewed-on: https://go-review.googlesource.com/21050
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      0659cf69
    • Keith Randall's avatar
      cmd/compile: start on ARM port · 4c9a470d
      Keith Randall authored
      Start working on arm port.  Gets close to correct
      code for fibonacci:
          func fib(n int) int {
              if n < 2 {
                  return n
              }
              return fib(n-1) + fib(n-2)
          }
      
      Still a lot to do, but this is a good starting point.
      
      Cleaned up some arch-specific dependencies in regalloc.
      
      Change-Id: I4301c6c31a8402168e50dcfee8bcf7aee73ea9d5
      Reviewed-on: https://go-review.googlesource.com/21000Reviewed-by: default avatarDavid Chase <drchase@google.com>
      4c9a470d
    • David Crawshaw's avatar
      cmd/link, reflect: remove some method type data · 44d3f89e
      David Crawshaw authored
      Remove reflect type information for unexported methods that do not
      satisfy any interface in the program.
      
      Ideally the unexported method would not appear in the method list at
      all, but that is tricky because the slice is built by the compiler.
      
      Reduces binary size:
      
      	cmd/go: 81KB (0.8%)
      	jujud: 258KB (0.4%)
      
      For #6853.
      
      Change-Id: I25ef8df6907e9ac03b18689d584ea46e7d773043
      Reviewed-on: https://go-review.googlesource.com/21033Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      44d3f89e
    • Alexandru Moșoi's avatar
      cmd/compile: don't simplify nilchecks in loops · c1892b9c
      Alexandru Moșoi authored
      khr: Lifting the nil check out of the loop altogether is an admirable
      goal, and this rewrite is one step on the way. But without lifting it
      out of the loop, the rewrite is just hurting us.
      
      Fixes #14917
      
      Change-Id: Idb917f37d89f50f8e046d5ebd7c092b1e0eb0633
      Reviewed-on: https://go-review.googlesource.com/21040Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c1892b9c
    • Lynn Boger's avatar
      bytes: Equal perf improvements on ppc64le/ppc64 · baec1487
      Lynn Boger authored
      The existing implementation for Equal and similar
      functions in the bytes package operate on one byte at
      at time.  This performs poorly on ppc64/ppc64le especially
      when the byte buffers are large.  This change improves
      those functions by loading and comparing double words where
      possible.  The common code has been moved to a function
      that can be shared by the other functions in this
      file which perform the same type of comparison.
      Further optimizations are done for the case where
      >= 32 bytes are being compared.  The new function
      memeqbody is used by memeq_varlen, Equal, and eqstring.
      
      When running the bytes test with -test.bench=Equal
      
      benchmark                     old MB/s     new MB/s     speedup
      BenchmarkEqual1               164.83       129.49       0.79x
      BenchmarkEqual6               563.51       445.47       0.79x
      BenchmarkEqual9               656.15       1099.00      1.67x
      BenchmarkEqual15              591.93       1024.30      1.73x
      BenchmarkEqual16              613.25       1914.12      3.12x
      BenchmarkEqual20              682.37       1687.04      2.47x
      BenchmarkEqual32              807.96       3843.29      4.76x
      BenchmarkEqual4K              1076.25      23280.51     21.63x
      BenchmarkEqual4M              1079.30      13120.14     12.16x
      BenchmarkEqual64M             1073.28      10876.92     10.13x
      
      It was determined that the degradation in the smaller byte tests
      were due to unfavorable code alignment of the single byte loop.
      
      Fixes #14368
      
      Change-Id: I0dd87382c28887c70f4fbe80877a8ba03c31d7cd
      Reviewed-on: https://go-review.googlesource.com/20249Reviewed-by: default avatarMinux Ma <minux@golang.org>
      baec1487