1. 20 Apr, 2015 13 commits
    • Rick Hudson's avatar
      runtime: Speed up heapBitsForObject · 899a4ad4
      Rick Hudson authored
      Optimized heapBitsForObject by special casing
      objects whose size is a power of two. When a
      span holding such objects is initialized I
      added a mask that when &ed with an interior pointer
      results in the base of the pointer. For the garbage
      benchmark this resulted in CPU_CLK_UNHALTED in
      heapBitsForObject going from 7.7% down to 5.9%
      of the total, INST_RETIRED went from 12.2 -> 8.7.
      
      Here are the benchmarks that were at lease plus or minus 1%.
      
      benchmark                          old ns/op      new ns/op      delta
      BenchmarkFmtFprintfString          249            221            -11.24%
      BenchmarkFmtFprintfInt             247            223            -9.72%
      BenchmarkFmtFprintfEmpty           76.5           69.6           -9.02%
      BenchmarkBinaryTree17              4106631412     3744550160     -8.82%
      BenchmarkFmtFprintfFloat           424            399            -5.90%
      BenchmarkGoParse                   4484421        4242115        -5.40%
      BenchmarkGobEncode                 8803668        8449107        -4.03%
      BenchmarkFmtManyArgs               1494           1436           -3.88%
      BenchmarkGobDecode                 10431051       10032606       -3.82%
      BenchmarkFannkuch11                2591306713     2517400464     -2.85%
      BenchmarkTimeParse                 361            371            +2.77%
      BenchmarkJSONDecode                70620492       68830357       -2.53%
      BenchmarkRegexpMatchMedium_1K      54693          53343          -2.47%
      BenchmarkTemplate                  90008879       91929940       +2.13%
      BenchmarkTimeFormat                380            387            +1.84%
      BenchmarkRegexpMatchEasy1_32       111            113            +1.80%
      BenchmarkJSONEncode                21359159       21007583       -1.65%
      BenchmarkRegexpMatchEasy1_1K       603            613            +1.66%
      BenchmarkRegexpMatchEasy0_32       127            129            +1.57%
      BenchmarkFmtFprintfIntInt          399            393            -1.50%
      BenchmarkRegexpMatchEasy0_1K       373            378            +1.34%
      
      Change-Id: I78e297161026f8b5cc7507c965fd3e486f81ed29
      Reviewed-on: https://go-review.googlesource.com/8980Reviewed-by: 's avatarAustin Clements <austin@google.com>
      899a4ad4
    • Matthew Dempsky's avatar
      cmd/internal/obj: remove useless Trimpath field and fix users · e7ffafdb
      Matthew Dempsky authored
      http://golang.org/cl/7623 refactored how line history works and
      introduced a new TrimPathPrefix field to replace the existing Trimpath
      field, but never removed the latter or updated its users.
      
      Fixes #10503.
      
      Change-Id: Ief90a55b6cef2e8062b59856a4c7dcc0df01d3f2
      Reviewed-on: https://go-review.googlesource.com/9113Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      e7ffafdb
    • Brad Fitzpatrick's avatar
      net/http: fix Transport data race, double cancel panic, cancel error message · b016eba4
      Brad Fitzpatrick authored
      Fixes #9496
      Fixes #9946
      Fixes #10474
      Fixes #10405
      
      Change-Id: I4e65f1706e46499811d9ebf4ad6d83a5dfb2ddaa
      Reviewed-on: https://go-review.googlesource.com/8550Reviewed-by: 's avatarDaniel Morsing <daniel.morsing@gmail.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      b016eba4
    • Russ Cox's avatar
      cmd/internal/gc: clean up componentgen · 35b1dcc2
      Russ Cox authored
      This is primarily about making the code clearer, but as part of the cleanup
      componentgen is now much more consistent about what it does and does
      not attempt.
      
      The new limit is to 8 move instructions.
      
      The old limit was either 3 or 4 small things but in the details it was
      quite inconsistent: ints, interfaces, strings, and slices all counted as small;
      it handled a struct containing two ints, but not a struct containing a struct
      containing two ints; it handled slices and interfaces and a struct containing
      a slice but not a struct containing an interface; and so on.
      
      The new code runs at about the same speed as the old code if limited to 4 moves,
      but that's much more restrictive when the pieces are strings or interfaces.
      With the limit raised to 8 moves, this CL is sometimes a significant improvement:
      
      benchmark                          old ns/op      new ns/op      delta
      BenchmarkBinaryTree17              4361174290     4362870005     +0.04%
      BenchmarkFannkuch11                3008201483     2974408533     -1.12%
      BenchmarkFmtFprintfEmpty           79.0           79.5           +0.63%
      BenchmarkFmtFprintfString          281            261            -7.12%
      BenchmarkFmtFprintfInt             264            262            -0.76%
      BenchmarkFmtFprintfIntInt          447            443            -0.89%
      BenchmarkFmtFprintfPrefixedInt     354            361            +1.98%
      BenchmarkFmtFprintfFloat           500            452            -9.60%
      BenchmarkFmtManyArgs               1688           1693           +0.30%
      BenchmarkGobDecode                 11718456       11741179       +0.19%
      BenchmarkGobEncode                 10144620       10161627       +0.17%
      BenchmarkGzip                      437631642      435271877      -0.54%
      BenchmarkGunzip                    109468858      110173606      +0.64%
      BenchmarkHTTPClientServer          76248          75362          -1.16%
      BenchmarkJSONEncode                24160474       23753091       -1.69%
      BenchmarkJSONDecode                84470041       82902026       -1.86%
      BenchmarkMandelbrot200             4676857        4687040        +0.22%
      BenchmarkGoParse                   4954602        4923965        -0.62%
      BenchmarkRegexpMatchEasy0_32       151            151            +0.00%
      BenchmarkRegexpMatchEasy0_1K       450            452            +0.44%
      BenchmarkRegexpMatchEasy1_32       131            130            -0.76%
      BenchmarkRegexpMatchEasy1_1K       713            695            -2.52%
      BenchmarkRegexpMatchMedium_32      227            218            -3.96%
      BenchmarkRegexpMatchMedium_1K      63911          62966          -1.48%
      BenchmarkRegexpMatchHard_32        3163           3026           -4.33%
      BenchmarkRegexpMatchHard_1K        93985          90266          -3.96%
      BenchmarkRevcomp                   650697093      649211600      -0.23%
      BenchmarkTemplate                  107049170      106804076      -0.23%
      BenchmarkTimeParse                 448            452            +0.89%
      BenchmarkTimeFormat                468            460            -1.71%
      
      Change-Id: I08563133883e88bb9db9e9e4dee438a5af2787da
      Reviewed-on: https://go-review.googlesource.com/9004Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
      35b1dcc2
    • Russ Cox's avatar
      runtime: replace func-based write barrier skipping with type-based · 181e26b9
      Russ Cox authored
      This CL revises CL 7504 to use explicitly uintptr types for the
      struct fields that are going to be updated sometimes without
      write barriers. The result is that the fields are now updated *always*
      without write barriers.
      
      This approach has two important properties:
      
      1) Now the GC never looks at the field, so if the missing reference
      could cause a problem, it will do so all the time, not just when the
      write barrier is missed at just the right moment.
      
      2) Now a write barrier never happens for the field, avoiding the
      (correct) detection of inconsistent write barriers when GODEBUG=wbshadow=1.
      
      Change-Id: Iebd3962c727c0046495cc08914a8dc0808460e0e
      Reviewed-on: https://go-review.googlesource.com/9019Reviewed-by: 's avatarAustin Clements <austin@google.com>
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      181e26b9
    • Matthew Dempsky's avatar
      cmd/internal/ld: prefer constants from cmd/internal/obj · c776592a
      Matthew Dempsky authored
      The majority of this CL was prepared via scripted invocations of
      `gofmt -w -r "$SYM -> obj.$SYM" cmd/internal/ld/*.go` and `gofmt -w -r
      "ld.$SYM -> obj.$SYM" cmd/?l/*.go`.
      
      Because of issue #7417, that was followed by repeatedly running an AWK
      script to identify lines that differed other than whitespace changes
      or "ld." or "obj." prefixes and manually restoring comments.
      
      Finally, the redundant constants from cmd/internal/ld/link.go were
      removed, and "goimports -w" was used to cleanup import lines.
      
      Passes rsc.io/toolstash/buildall, even when modified to also build cmd.
      
      Fixes #10055.
      
      Change-Id: Icd5dbe819a3b6520ce883748e60017dc8e9a2e85
      Reviewed-on: https://go-review.googlesource.com/9112Reviewed-by: 's avatarMichael Hudson-Doyle <michael.hudson@canonical.com>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      c776592a
    • Russ Cox's avatar
      cmd/dist: run commands in $GOROOT/src not $GOROOT when possible · 6e221a90
      Russ Cox authored
      The go command prints paths in errors relative to its current directory.
      Since all.bash and run.bash are run in $GOROOT/src, prefer to run
      the go command, so that the relative paths are correct.
      
      Before this CL, running all.bash in $GOROOT/src:
      
      	##### Testing race detector
      	# net/http
      	src/net/http/transport.go:1257: cannot take the address of <node EFACE>
      
      This is wrong (or at least less useful) because there is no $GOROOT/src/src/net/http directory.
      
      Change-Id: I0c0d52c22830d79b3715f51a6329a3d33de52a72
      Reviewed-on: https://go-review.googlesource.com/9157Reviewed-by: 's avatarRob Pike <r@golang.org>
      6e221a90
    • Ian Lance Taylor's avatar
      runtime: save registers in linux/{386,amd64} lib entry point · 357a0130
      Ian Lance Taylor authored
      The callee-saved registers must be saved because for the c-shared case
      this code is invoked from C code in the system library, and that code
      expects the registers to be saved.  The tests were passing because in
      the normal case the code calls a cgo function that naturally saves
      callee-saved registers anyhow.  However, it fails when the code takes
      the non-cgo path.
      
      Change-Id: I9c1f5e884f5a72db9614478049b1863641c8b2b9
      Reviewed-on: https://go-review.googlesource.com/9114Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      357a0130
    • Ian Lance Taylor's avatar
      runtime: no deadlock error if buildmode=c-archive or c-shared · 725aa345
      Ian Lance Taylor authored
      Change-Id: I4ee6dac32bd3759aabdfdc92b235282785fbcca9
      Reviewed-on: https://go-review.googlesource.com/9083Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      725aa345
    • Brad Fitzpatrick's avatar
      cmd/internal/obj: manual C->Go cleanups · a13cf8c1
      Brad Fitzpatrick authored
      Change-Id: I5964fc55157dc1df7be400dfa0df591d6163e25e
      Reviewed-on: https://go-review.googlesource.com/9084Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      a13cf8c1
    • David Crawshaw's avatar
      cmd/dist: enable c-archive test on darwin/arm64 · 3f4de49d
      David Crawshaw authored
      Turns out all the necessary pieces have already been submitted.
      
      Change-Id: I19c8d614cd756821ce400ca7a338029002780b18
      Reviewed-on: https://go-review.googlesource.com/9076Reviewed-by: 's avatarHyang-Ah Hana Kim <hyangah@gmail.com>
      3f4de49d
    • David Crawshaw's avatar
      misc/cgo/testcarchive: enable test on darwin/arm · 98f610fe
      David Crawshaw authored
      Change-Id: I0d3f9841500e0a41f1c427244869bf3736a31e18
      Reviewed-on: https://go-review.googlesource.com/9075Reviewed-by: 's avatarHyang-Ah Hana Kim <hyangah@gmail.com>
      98f610fe
    • Hyang-Ah Hana Kim's avatar
      cmd/dist: include misc/cgo/testcshared test for linux/amd64 · 983a490e
      Hyang-Ah Hana Kim authored
      Change-Id: Ia2c0c617df523482ba1a25b7492267eb80f0819a
      Reviewed-on: https://go-review.googlesource.com/9033
      Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      983a490e
  2. 19 Apr, 2015 2 commits
  3. 18 Apr, 2015 9 commits
  4. 17 Apr, 2015 16 commits