- 14 Mar, 2017 15 commits
-
-
Michael Stapelberg authored
Given the following test cases: $ cat left_too_many.go package main func main() { a, err := make([]int, 1) } $ cat right_too_many.go package main func main() { a := "foo", "bar" } Before this change, the error messages are: ./left_too_many.go:4: assignment count mismatch: 2 = 1 ./right_too_many.go:4: assignment count mismatch: 1 = 2 After this change, the error messages are: ./left_too_many.go:4: assignment count mismatch: want 2 values, got 1 ./right_too_many.go:4: assignment count mismatch: want 1 values, got 2 Change-Id: I9ad346f122406bc9a785bf690ed7b3de76a422da Reviewed-on: https://go-review.googlesource.com/33616Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Change-Id: I0f7eec2e0c15a355422d5ae7289508a5bd33b971 Reviewed-on: https://go-review.googlesource.com/38171 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
philhofer 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: I57d4dc21ef40a05ec0fbd55a9bb0eb74cdc67a3d Reviewed-on: https://go-review.googlesource.com/38139 Run-TryBot: Philip Hofer <phofer@umich.edu> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Matthew Dempsky authored
Changes to ${GOARCH}Ops.go files were mechanically produced using github.com/mdempsky/ssa-symops, a one-off tool that inserts "SymEffect: X" elements by pattern matching against the Op names. Change-Id: Ibf3e481ffd588647f2a31662d72114b740ccbfcf Reviewed-on: https://go-review.googlesource.com/38084 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Matthew Dempsky authored
To replace the progeffects tables for liveness analysis. Change-Id: Idc4b990665cb0a9aa300d62cdf8ad12e51c5b991 Reviewed-on: https://go-review.googlesource.com/38083 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Josh Bleecher Snyder authored
Bad pragmas should never make it to the backend. I've confirmed manually that the error position is unchanged. Updates #15756 Updates #19250 Change-Id: If14f7ce868334f809e337edc270a49680b26f48e Reviewed-on: https://go-review.googlesource.com/38152 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Brad Fitzpatrick authored
Retry the test several times with increasingly long timeouts. Fixes #19538 (hopefully) Change-Id: Ia3bf2b63b4298a6ee1e4082e14d9bfd5922c293a Reviewed-on: https://go-review.googlesource.com/38154 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
There were a surprising number of places in the tree that used yyerror for failed internal consistency checks. Switch them to Fatalf. Updates #15756 Updates #19250 Change-Id: Ie4278148185795a28ff3c27dacffc211cda5bbdd Reviewed-on: https://go-review.googlesource.com/38153 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
fn == Curfn in this context. Prefer the local variable. Passes toolstash -cmp. Updates #15756. Change-Id: I75b589c682d0c1b524cac2bbf2bba368a6027b06 Reviewed-on: https://go-review.googlesource.com/38151 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Used gorename. Change-Id: Ib33305dc95876ec18e2473ad2999788a32eb21c0 Reviewed-on: https://go-review.googlesource.com/38146 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
Josh Bleecher Snyder authored
It is unnecessary. Passes toolstash -cmp. Change-Id: I7c03523b6110c3d9bd5ba2b37d9a1e17a7ae570e Reviewed-on: https://go-review.googlesource.com/38145 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Passes toolstash -cmp. Change-Id: I678fc40c0f2a6e9a434bcdd4ea17bb7f319a6063 Reviewed-on: https://go-review.googlesource.com/38144 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Reduces duplication and centralizes documentation. Moves all uses of FmtUnsigned and tconv inside fmt.go. Passes toolstash -cmp. Change-Id: If6d906e7e839de05f36423523a3a1d596e29807d Reviewed-on: https://go-review.googlesource.com/38141 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Josh Bleecher Snyder authored
For consistency. Change-Id: Ic687fea95f7a4a3be576945af3e9c97086309b07 Reviewed-on: https://go-review.googlesource.com/38142 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: I9339e83e39075826bf5819e55804a94208fe84ae Reviewed-on: https://go-review.googlesource.com/38140 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 13 Mar, 2017 17 commits
-
-
Hugues Bruant authored
Add benchmarks for map assignment with int32/int64/string key Benchmark results on darwin/amd64 name old time/op new time/op delta MapAssignInt32_255-8 24.7ns ± 3% 17.4ns ± 2% -29.75% (p=0.000 n=10+10) MapAssignInt32_64k-8 45.5ns ± 4% 37.6ns ± 4% -17.18% (p=0.000 n=10+10) MapAssignInt64_255-8 26.0ns ± 3% 17.9ns ± 4% -31.03% (p=0.000 n=10+10) MapAssignInt64_64k-8 46.9ns ± 5% 38.7ns ± 2% -17.53% (p=0.000 n=9+10) MapAssignStr_255-8 47.8ns ± 3% 24.8ns ± 4% -48.01% (p=0.000 n=10+10) MapAssignStr_64k-8 83.0ns ± 3% 51.9ns ± 3% -37.45% (p=0.000 n=10+9) name old time/op new time/op delta BinaryTree17-8 3.11s ±19% 2.78s ± 3% ~ (p=0.095 n=5+5) Fannkuch11-8 3.26s ± 1% 3.21s ± 2% ~ (p=0.056 n=5+5) FmtFprintfEmpty-8 50.3ns ± 1% 50.8ns ± 2% ~ (p=0.246 n=5+5) FmtFprintfString-8 82.7ns ± 4% 80.1ns ± 5% ~ (p=0.238 n=5+5) FmtFprintfInt-8 82.6ns ± 2% 81.9ns ± 3% ~ (p=0.508 n=5+5) FmtFprintfIntInt-8 124ns ± 4% 121ns ± 3% ~ (p=0.111 n=5+5) FmtFprintfPrefixedInt-8 158ns ± 6% 160ns ± 2% ~ (p=0.341 n=5+5) FmtFprintfFloat-8 249ns ± 2% 245ns ± 2% ~ (p=0.095 n=5+5) FmtManyArgs-8 513ns ± 2% 519ns ± 3% ~ (p=0.151 n=5+5) GobDecode-8 7.48ms ±12% 7.11ms ± 2% ~ (p=0.222 n=5+5) GobEncode-8 6.25ms ± 1% 6.03ms ± 2% -3.56% (p=0.008 n=5+5) Gzip-8 252ms ± 4% 252ms ± 4% ~ (p=1.000 n=5+5) Gunzip-8 38.4ms ± 3% 38.6ms ± 2% ~ (p=0.690 n=5+5) HTTPClientServer-8 76.9µs ±41% 66.4µs ± 6% ~ (p=0.310 n=5+5) JSONEncode-8 16.5ms ± 3% 16.7ms ± 3% ~ (p=0.421 n=5+5) JSONDecode-8 54.6ms ± 1% 54.3ms ± 2% ~ (p=0.548 n=5+5) Mandelbrot200-8 4.45ms ± 3% 4.47ms ± 1% ~ (p=0.841 n=5+5) GoParse-8 3.43ms ± 1% 3.32ms ± 2% -3.28% (p=0.008 n=5+5) RegexpMatchEasy0_32-8 88.2ns ± 3% 89.4ns ± 2% ~ (p=0.333 n=5+5) RegexpMatchEasy0_1K-8 205ns ± 1% 206ns ± 1% ~ (p=0.905 n=5+5) RegexpMatchEasy1_32-8 85.1ns ± 1% 85.5ns ± 5% ~ (p=0.690 n=5+5) RegexpMatchEasy1_1K-8 365ns ± 1% 371ns ± 9% ~ (p=1.000 n=5+5) RegexpMatchMedium_32-8 129ns ± 2% 128ns ± 3% ~ (p=0.730 n=5+5) RegexpMatchMedium_1K-8 39.8µs ± 0% 39.7µs ± 4% ~ (p=0.730 n=4+5) RegexpMatchHard_32-8 1.99µs ± 3% 2.05µs ±16% ~ (p=0.794 n=5+5) RegexpMatchHard_1K-8 59.3µs ± 1% 60.3µs ± 7% ~ (p=1.000 n=5+5) Revcomp-8 1.36s ±63% 0.52s ± 5% ~ (p=0.095 n=5+5) Template-8 62.6ms ±14% 60.5ms ± 5% ~ (p=0.690 n=5+5) TimeParse-8 330ns ± 2% 324ns ± 2% ~ (p=0.087 n=5+5) TimeFormat-8 350ns ± 3% 340ns ± 1% -2.86% (p=0.008 n=5+5) name old speed new speed delta GobDecode-8 103MB/s ±11% 108MB/s ± 2% ~ (p=0.222 n=5+5) GobEncode-8 123MB/s ± 1% 127MB/s ± 2% +3.71% (p=0.008 n=5+5) Gzip-8 77.1MB/s ± 4% 76.9MB/s ± 3% ~ (p=1.000 n=5+5) Gunzip-8 505MB/s ± 3% 503MB/s ± 2% ~ (p=0.690 n=5+5) JSONEncode-8 118MB/s ± 3% 116MB/s ± 3% ~ (p=0.421 n=5+5) JSONDecode-8 35.5MB/s ± 1% 35.8MB/s ± 2% ~ (p=0.397 n=5+5) GoParse-8 16.9MB/s ± 1% 17.4MB/s ± 2% +3.45% (p=0.008 n=5+5) RegexpMatchEasy0_32-8 363MB/s ± 3% 358MB/s ± 2% ~ (p=0.421 n=5+5) RegexpMatchEasy0_1K-8 4.98GB/s ± 1% 4.97GB/s ± 1% ~ (p=0.548 n=5+5) RegexpMatchEasy1_32-8 376MB/s ± 1% 375MB/s ± 5% ~ (p=0.690 n=5+5) RegexpMatchEasy1_1K-8 2.80GB/s ± 1% 2.76GB/s ± 9% ~ (p=0.841 n=5+5) RegexpMatchMedium_32-8 7.73MB/s ± 1% 7.76MB/s ± 3% ~ (p=0.730 n=5+5) RegexpMatchMedium_1K-8 25.8MB/s ± 0% 25.8MB/s ± 4% ~ (p=0.651 n=4+5) RegexpMatchHard_32-8 16.1MB/s ± 3% 15.7MB/s ±14% ~ (p=0.794 n=5+5) RegexpMatchHard_1K-8 17.3MB/s ± 1% 17.0MB/s ± 7% ~ (p=0.984 n=5+5) Revcomp-8 273MB/s ±83% 488MB/s ± 5% ~ (p=0.095 n=5+5) Template-8 31.1MB/s ±13% 32.1MB/s ± 5% ~ (p=0.690 n=5+5) Updates #19495 Change-Id: I116e9a2a4594769318b22d736464de8a98499909 Reviewed-on: https://go-review.googlesource.com/38091Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Aliaksandr Valialkin authored
vet should properly handle shift calculations via "unsafe" package after the CL 37950. Change-Id: I7737f2e656a5166337a17b92db46a0997f2a4e0e Reviewed-on: https://go-review.googlesource.com/38064Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Passes toolstash-check -all. Change-Id: Id389f8158cf33a3c0fcef373615b5351e7c74b5b Reviewed-on: https://go-review.googlesource.com/38082 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
David Chase authored
This reverts commit 4e0c7c3f. Reason for revert: The presence-of-optimization test program is fragile, breaks under noopt, and might break if the Go libraries are tweaked. It needs to be (re)written without reference to other packages. Change-Id: I3aaf1ab006a1a255f961a978e9c984341740e3c7 Reviewed-on: https://go-review.googlesource.com/38097Reviewed-by: Keith Randall <khr@golang.org>
-
Matthew Dempsky authored
This abstracts creation of ACALL Progs into package gc. The main benefit of this today is we can refactor away a lot of common boilerplate code. Later, once liveness analysis happens on the SSA graph, this will also provide an easy insertion point for emitting the PCDATA Progs immediately before call instructions. Passes toolstash-check -all. Change-Id: Ia15108ace97201cd84314f1ca916dfeb4f09d61c Reviewed-on: https://go-review.googlesource.com/38081Reviewed-by: Keith Randall <khr@golang.org>
-
Alberto Donizetti authored
Tinkering with the gob package shows that is currently possible to *completely destroy* Int slices encoding without triggering a single test failure. The various encInt{8,16,32,64}Slice methods are only called during the execution of the GobMapInterfaceEncode test, which only encodes a few slices of length exactly 1 and then just checks that the error returned by Encode is nil (without trying to Decode back the data). This patch adds a few tests for signed integer slices encoding. Change-Id: Ifaaee2f32132873118b241f79aa8203e4ad31416 Reviewed-on: https://go-review.googlesource.com/38066Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Passes toolstash-check -all. Change-Id: Icf8b75364e4761a5e56567f503b2c1cb17382ed2 Reviewed-on: https://go-review.googlesource.com/38080 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
khr authored
Move the zeroing of results earlier. In particular, they need to come before any move-to-heap operations, as those require allocation. Those allocations are points at which the GC can see the uninitialized result slots. For the function: func f() (x, y, z *int) { defer(){}() escape(&y) return } We used to generate code like this: x = nil y = nil &y = new(int) z = nil Now we will generate: x = nil y = nil z = nil &y = new(int) Since the fix for #18860, the return slots are always live if there is a defer, so the former ordering allowed the GC to see junk in the z slot. Fixes #19078 Change-Id: I71554ae437549725bb79e13b2c100b2911d47ed4 Reviewed-on: https://go-review.googlesource.com/38133 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Ilya Tocar authored
Since https://go-review.googlesource.com/24040 we no longer pad functions in asm6, so funcAlign is unused. Delete it. Change-Id: Id710e545a76b1797398f2171fe7e0928811fcb31 Reviewed-on: https://go-review.googlesource.com/38134Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
The existing implementation started by eliminating nil checks for OpAddr, OpAddPtr, and OpPhis with all non-nil args. However, some OpPhis had all non-nil args, but their args had not been processed yet. Pull the OpPhi checks into their own loop, and repeat until stabilization. Eliminates a dozen additional nilchecks during make.bash. Negligible compiler performance impact. Change-Id: If7b803c3ad7582af7d9867d05ca13e03e109d864 Reviewed-on: https://go-review.googlesource.com/37999 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
-
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: Keith Randall <khr@golang.org>
-
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: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Rob Pike <r@golang.org>
-
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: Brad Fitzpatrick <bradfitz@golang.org>
-
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: Brad Fitzpatrick <bradfitz@golang.org>
-
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: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
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: Brad Fitzpatrick <bradfitz@golang.org>
-
Marcel Edmund Franke authored
Call body close after ioutil.ReadAll is done Change-Id: Ieceb1965a6a8f2dbc024e983acdfe22df17d07d1 Reviewed-on: https://go-review.googlesource.com/38059Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 12 Mar, 2017 2 commits
-
-
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: Robert Griesemer <gri@golang.org>
-
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: Brad Fitzpatrick <bradfitz@golang.org>
-
- 11 Mar, 2017 4 commits
-
-
Aliaksandr Valialkin authored
Determine int, uint and uintptr bit sizes from GOARCH environment variable if it is set. Otherwise use host-specific sizes. Fixes #19321 Change-Id: I494b8e4b49b59d32794f50ff2ce06ba040cb8460 Reviewed-on: https://go-review.googlesource.com/37950 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Ian Lance Taylor authored
This avoids a problem that occurs on FreeBSD 11, in which the clang 3.8 assembler issues a pointless warning when invoked with -g on a file that contains an empty .note.GNU-stack section. No test because there is no reasonable way to write one, but should fix the build on FreeBSD 11. Fixes #14705. Change-Id: I8c49bbf79a2c715c0e75495da19045fc92280e81 Reviewed-on: https://go-review.googlesource.com/38072 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
nat.setUint64 is nicely generic. By assuming 32- or 64-bit words, however, we can write simpler code, and eliminate some shifts in dead code that vet complains about. Generated code for 64 bit systems is unaltered. Generated code for 32 bit systems is much better. For 386, the routine length drops from 325 bytes of code to 271 bytes of code, with fewer loops. Change-Id: I1bc14c06272dee37a7fcb48d33dd1e621eba945d Reviewed-on: https://go-review.googlesource.com/38070 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Robert Griesemer authored
The compiler recognizes that in a sequence q = x/y; r = x%y only one division is required. Remove prior work-arounds and write more readable straight-line code (this also results in fewer instructions, though it doesn't appear to affect the benchmarks significantly). name old time/op new time/op delta FormatInt-8 2.95µs ± 1% 2.92µs ± 5% ~ (p=0.952 n=5+5) AppendInt-8 1.91µs ± 1% 1.89µs ± 2% ~ (p=0.421 n=5+5) FormatUint-8 795ns ± 2% 782ns ± 4% ~ (p=0.444 n=5+5) AppendUint-8 557ns ± 1% 557ns ± 2% ~ (p=0.548 n=5+5) https://perf.golang.org/search?q=upload:20170310.1 Also: - use uint instead of uintptr where we want to guarantee single- register operations - remove some unnecessary conversions (before indexing) - add more comments and fix some comments Change-Id: I04858dc2d798a6495879d9c7cfec2fdc2957b704 Reviewed-on: https://go-review.googlesource.com/38071Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 10 Mar, 2017 2 commits
-
-
David NewHamlet authored
In FreeBSD when run Go proc under a given sub-list of processors(e.g. 'cpuset -l 0 ./a.out' in multi-core system), runtime.NumCPU() still return all physical CPUs from sysctl hw.ncpu instead of account from sub-list. Fix by use syscall cpuset_getaffinity to account the number of sub-list. Fixes #15206 Change-Id: If87c4b620e870486efa100685db5debbf1210a5b Reviewed-on: https://go-review.googlesource.com/29341Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
We are vendoring pprof from github.com/google/pprof, which comes with a main package. If we don't explicitly skip that main package, then `go install cmd` will install the compiled program in $GOROOT/bin. Fixes #19441. Change-Id: Ib268ffd16d4be65f7d80e4f8d9dc6e71523a94de Reviewed-on: https://go-review.googlesource.com/38007 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Raul Silvera <rsilvera@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-