1. 13 Mar, 2017 7 commits
    • Philip Hofer's avatar
      cmd/compile: de-virtualize interface calls · 4e0c7c3f
      Philip Hofer authored
      With this change, code like
      
          h := sha1.New()
          h.Write(buf)
          sum := h.Sum()
      
      gets compiled into static calls rather than
      interface calls, because the compiler is able
      to prove that 'h' is really a *sha1.digest.
      
      The InterCall re-write rule hits a few dozen times
      during make.bash, and hundreds of times during all.bash.
      
      The most common pattern identified by the compiler
      is a constructor like
      
          func New() Interface { return &impl{...} }
      
      where the constructor gets inlined into the caller,
      and the result is used immediately. Examples include
      {sha1,md5,crc32,crc64,...}.New, base64.NewEncoder,
      base64.NewDecoder, errors.New, net.Pipe, and so on.
      
      Some existing benchmarks that change on darwin/amd64:
      
      Crc64/ISO4KB-8        2.67µs ± 1%    2.66µs ± 0%  -0.36%  (p=0.015 n=10+10)
      Crc64/ISO1KB-8         694ns ± 0%     690ns ± 1%  -0.59%  (p=0.001 n=10+10)
      Adler32KB-8            473ns ± 1%     471ns ± 0%  -0.39%  (p=0.010 n=10+9)
      
      On architectures like amd64, the reduction in code size
      appears to contribute more to benchmark improvements than just
      removing the indirect call, since that branch gets predicted
      accurately when called in a loop.
      
      Updates #19361
      
      Change-Id: Ia9d30afdd5f6b4d38d38b14b88f308acae8ce7ed
      Reviewed-on: https://go-review.googlesource.com/37751
      Run-TryBot: Philip Hofer <phofer@umich.edu>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      4e0c7c3f
    • Robert Griesemer's avatar
      spec: remove superfluous terms "delimiter" and "special tokens" · 26e726c3
      Robert Griesemer authored
      The (original) section on "Operators and Delimiters" introduced
      superfluous terminology ("delimiter", "special token") which
      didn't matter and was used inconsistently.
      
      Removed any mention of "delimiter" or "special token" and now
      simply group the special character tokens into "operators"
      (clearly defined via links), and "punctuation" (everything else).
      
      Fixes #19450.
      
      Change-Id: Ife31b24b95167ace096f93ed180b7eae41c66808
      Reviewed-on: https://go-review.googlesource.com/38073Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: 's avatarRob Pike <r@golang.org>
      26e726c3
    • Chew Choon Keat's avatar
      net/http: unset proxy environment after test · eb715fbb
      Chew Choon Keat authored
      Fix last proxy in TestProxyFromEnvironment bleeds into other tests
      Change ResetProxyEnv to use the newer os.Unsetenv, instead of hard
      coding as ""
      
      Change-Id: I67cf833dbcf4bec2e10ea73c354334160cf05f84
      Reviewed-on: https://go-review.googlesource.com/38115
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      eb715fbb
    • Dave Cheney's avatar
      cmd/compile/internal/gc: remove unused exportsize variable · dd0e1acf
      Dave Cheney authored
      In Go 1.7 and earlier, gc.exportsize tracked the number of bytes
      written through exportf. With the removal of the old exporter in Go 1.8
      exportf is only used for printing the build id, and the header and
      trailer of the binary export format. The size of the export data is
      now returned directly from the exporter and exportsize is never
      referenced. Remove it.
      
      Change-Id: Id301144b3c26c9004c722d0c55c45b0e0801a88c
      Reviewed-on: https://go-review.googlesource.com/38116
      Run-TryBot: Dave Cheney <dave@cheney.net>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      dd0e1acf
    • Dave Cheney's avatar
      cmd/go/internal/get: remove unused tag selection code · d5a9fbd5
      Dave Cheney authored
      selectTag has been hard coded to only understand the tag `go1` since
      CL 6112060 which landed in 2012. The commit message asserted;
      
        Right now (before go1.0.1) there is only one possible tag,
        "go1", and I'd like to keep it that way.
      
      Remove goTag and the unused matching code in selectTag.
      
      Change-Id: I85f7c10f95704e22f8e8681266afd72bbcbe8fbd
      Reviewed-on: https://go-review.googlesource.com/38112Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d5a9fbd5
    • Dave Cheney's avatar
      runtime: remove sizeToClass · 7ee43faf
      Dave Cheney authored
      CL 32219 added precomputed sizeclass tables.
      
      Remove the unused sizeToClass method which was previously only
      called from initSizes.
      
      Change-Id: I907bf9ed78430ecfaabbec7fca77ef2375010081
      Reviewed-on: https://go-review.googlesource.com/38113
      Run-TryBot: Dave Cheney <dave@cheney.net>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      7ee43faf
    • Marcel Edmund Franke's avatar
      net/http: fix body close statement is missing · e831bd1f
      Marcel Edmund Franke authored
      Call body close after ioutil.ReadAll is done
      
      Change-Id: Ieceb1965a6a8f2dbc024e983acdfe22df17d07d1
      Reviewed-on: https://go-review.googlesource.com/38059Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e831bd1f
  2. 12 Mar, 2017 2 commits
    • Martin Möhrmann's avatar
      strconv: fix performance regression in integer formatting on 32bit platforms · b71ed4ed
      Martin Möhrmann authored
      Some of the changes in CL golang.org/cl/38071/ assumed that / and %
      could always be combined to use only one DIV instruction. However,
      this is not the case for 64bit operands on a 32bit platform which use
      seperate runtime functions to calculate division and modulo.
      
      This CL restores the original optimizations that help on 32bit platforms
      with negligible impact on 64bit platforms.
      
      386:
      name          old time/op  new time/op  delta
      FormatInt-2   6.06µs ± 0%  6.02µs ± 0%  -0.70%  (p=0.000 n=20+20)
      AppendInt-2   4.98µs ± 0%  4.98µs ± 0%    ~     (p=0.747 n=18+18)
      FormatUint-2  1.93µs ± 0%  1.85µs ± 0%  -4.19%  (p=0.000 n=20+20)
      AppendUint-2  1.71µs ± 0%  1.64µs ± 0%  -3.68%  (p=0.000 n=20+20)
      
      amd64:
      name          old time/op  new time/op  delta
      FormatInt-2   2.41µs ± 0%  2.41µs ± 0%  -0.09%  (p=0.010 n=18+18)
      AppendInt-2   1.77µs ± 0%  1.77µs ± 0%  +0.08%  (p=0.000 n=18+18)
      FormatUint-2   653ns ± 1%   653ns ± 0%    ~     (p=0.178 n=20+20)
      AppendUint-2   514ns ± 0%   513ns ± 0%  -0.13%  (p=0.000 n=20+17)
      
      Change-Id: I574a18e54fb41b25fbe51ce696e7a8765abc79a6
      Reviewed-on: https://go-review.googlesource.com/38051
      Run-TryBot: Martin Möhrmann <moehrmann@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      b71ed4ed
    • Matthew Dempsky's avatar
      cmd/link: eliminate markextra · d3434782
      Matthew Dempsky authored
      This appears to be leftover from when instruction selection happened
      in the linker. Many of the morestackX functions listed don't even
      exist anymore.
      
      Now that we select instructions within the compiler and assembler,
      normal deadcode elimination mechanisms should suffice for these
      symbols.
      
      Change-Id: I2cb1e435101392e7c983957c4acfbbcc87a5ca7d
      Reviewed-on: https://go-review.googlesource.com/38077
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      d3434782
  3. 11 Mar, 2017 4 commits
  4. 10 Mar, 2017 9 commits
  5. 09 Mar, 2017 14 commits
  6. 08 Mar, 2017 4 commits