- 03 Mar, 2019 1 commit
-
-
Daniel Martí authored
Most of the encoding time is spent in the first Encode loop, since the rest of the function only deals with the few remaining bytes. Any unnecessary work done in that loop body matters tremendously. One such unnecessary bottleneck was the use of the enc.encode table. Since enc is a pointer receiver, and the field is first used within the loop, the encoder must perform a nil check at every iteration. Add a dummy use of the field before the start of the loop, to move the nil check there. After that line, the compiler now knows that enc can't be nil, and thus the hot loop is free of nil checks. name old time/op new time/op delta EncodeToString-4 14.7µs ± 0% 13.7µs ± 1% -6.53% (p=0.000 n=10+10) name old speed new speed delta EncodeToString-4 559MB/s ± 0% 598MB/s ± 1% +6.99% (p=0.000 n=10+10) Updates #20206. Change-Id: Icbb523a7bd9e470a8be0a448d1d78ade97ed4ff6 Reviewed-on: https://go-review.googlesource.com/c/151158 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 02 Mar, 2019 22 commits
-
-
Elias Naur authored
According to https://stackoverflow.com/questions/46233200/stop-buffering-of-adb-shell-output the adb exec-out commands avoids the buffering inherent to adb shell. Let's see if using exec-out will fix the android builder flakyness where exitcodes or output were sometimes missing. Updates #30512 (perhaps fixes it). Change-Id: Ib953ef0262b20730e0d4c332058d29c5066bfeb2 Reviewed-on: https://go-review.googlesource.com/c/164661 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Daniel Martí authored
encoding/base64 already skips \r and \n when decoding, so this package must only deal with spaces and tabs. Those aren't nearly as common, so we can add a fast path with bytes.ContainsAny to skip the costly alloc and filtering code. name old time/op new time/op delta Decode-8 279µs ± 0% 259µs ± 1% -7.07% (p=0.002 n=6+6) name old speed new speed delta Decode-8 319MB/s ± 0% 343MB/s ± 1% +7.61% (p=0.002 n=6+6) name old alloc/op new alloc/op delta Decode-8 164kB ± 0% 74kB ± 0% -54.90% (p=0.002 n=6+6) name old allocs/op new allocs/op delta Decode-8 12.0 ± 0% 11.0 ± 0% -8.33% (p=0.002 n=6+6) Change-Id: Idfca8700c52f46eb70a4a7e0d2db3bf0124e4699 Reviewed-on: https://go-review.googlesource.com/c/155964 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Instead of allocating a byte slice for every string, calculated the required size and create a single slice big enough to hold all of them. As an added benefit, any error encountered will now be returned before allocations occur. os/exec package benchmarks: name old time/op new time/op delta ExecEcho-8 2.14ms ± 1% 2.14ms ± 3% ~ (p=0.842 n=10+9) name old alloc/op new alloc/op delta ExecEcho-8 6.35kB ± 0% 6.18kB ± 0% -2.65% (p=0.000 n=10+10) name old allocs/op new allocs/op delta ExecEcho-8 69.0 ± 0% 36.0 ± 0% -47.83% (p=0.000 n=10+10) Change-Id: I84118d8473037d873f73903d4e4f6ed14f531ce7 Reviewed-on: https://go-review.googlesource.com/c/164961 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
The common case is that most env vars are distinct; optimize for that. name old time/op new time/op delta ExecEcho-8 2.16ms ± 3% 2.14ms ± 1% ~ (p=0.315 n=10+10) name old alloc/op new alloc/op delta ExecEcho-8 7.87kB ± 0% 6.35kB ± 0% -19.31% (p=0.000 n=9+10) name old allocs/op new allocs/op delta ExecEcho-8 72.0 ± 0% 69.0 ± 0% -4.17% (p=0.000 n=10+10) Change-Id: I42bb696c6862f2ea12c5cbd2f24c64336a7a759a Reviewed-on: https://go-review.googlesource.com/c/164960 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: Ie955cdc505766447f70b8f262160fe05b60a5b0c Reviewed-on: https://go-review.googlesource.com/c/164959 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Agniva De Sarker authored
Fixes #25909 Change-Id: I9a53a1a06aab5d1877a8e9b1b8b782d77d6027a8 Reviewed-on: https://go-review.googlesource.com/c/157758Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Leon Klingele authored
Change-Id: I714612b41facc8d1ec22974e8aaf2a5a3592e8f5 GitHub-Last-Rev: a0b3917e45bc1d24590e9c9cb3550da4c4008c49 GitHub-Pull-Request: golang/go#29998 Reviewed-on: https://go-review.googlesource.com/c/160422 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Daniel Martí authored
Remove all multiplications and divisions from the main decoding loop. name old time/op new time/op delta Decode/256-8 323ns ± 0% 293ns ± 0% -9.29% (p=0.000 n=5+4) Decode/1024-8 1.26µs ± 0% 1.14µs ± 0% -9.48% (p=0.000 n=6+5) Decode/4096-8 4.99µs ± 0% 4.51µs ± 0% -9.55% (p=0.002 n=6+6) Decode/16384-8 20.0µs ± 0% 18.1µs ± 0% -9.54% (p=0.002 n=6+6) name old speed new speed delta Decode/256-8 791MB/s ± 0% 872MB/s ± 0% +10.34% (p=0.002 n=6+6) Decode/1024-8 814MB/s ± 0% 899MB/s ± 0% +10.48% (p=0.004 n=6+5) Decode/4096-8 821MB/s ± 0% 908MB/s ± 0% +10.55% (p=0.002 n=6+6) Decode/16384-8 821MB/s ± 0% 908MB/s ± 0% +10.54% (p=0.002 n=6+6) Change-Id: Ie9f91242ce04c130a77c1184379e3b9de38fe713 Reviewed-on: https://go-review.googlesource.com/c/151199 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Leon Klingele authored
Change-Id: Ieb0ae01cf393c4983e809ce95fedeaa854d19a99 GitHub-Last-Rev: 908f7565183c1cd19a3fbc47f406d53ad388fb97 GitHub-Pull-Request: golang/go#30004 Reviewed-on: https://go-review.googlesource.com/c/160428 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
LE Manh Cuong authored
Fixes #29193 Change-Id: I03088205e51036abbc861ab5b7d141327b0429ae Reviewed-on: https://go-review.googlesource.com/c/154383Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Iskander Sharipov authored
gogrep found only one such case with the pattern below: $tmp := $x; $x = $y; $y = $tmp R=1.13 Change-Id: I6e46fb5ef2887f24fa9fc451323a8cef272e2886 Reviewed-on: https://go-review.googlesource.com/c/151200 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Leon Klingele authored
Change-Id: I51a9c06384875fbb12db0e05128f23bd23a163a1 GitHub-Last-Rev: 126452f15cbb8e06ff683dcd60e63f1925dcf8f1 GitHub-Pull-Request: golang/go#30000 Reviewed-on: https://go-review.googlesource.com/c/160424Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Leon Klingele authored
Change-Id: Ie26b86c7502e41796732caad4d7e254246f70b7f GitHub-Last-Rev: 3b80c0e4b17ec2b2a5b95e40d5880df2b856c6dd GitHub-Pull-Request: golang/go#30002 Reviewed-on: https://go-review.googlesource.com/c/160426Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Leon Klingele authored
Change-Id: Id0e8d170730d946b60c661d90bc98d0ca7545391 GitHub-Last-Rev: 19fed775b7e87c8c721b4487458354a2d5532a6c GitHub-Pull-Request: golang/go#30001 Reviewed-on: https://go-review.googlesource.com/c/160425Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Leon Klingele authored
Change-Id: I54998f1b7daa8f8db7a2007b4eb86e9789c03656 GitHub-Last-Rev: 97667ead6f62dad2af0d6b1f78deccef16417044 GitHub-Pull-Request: golang/go#30006 Reviewed-on: https://go-review.googlesource.com/c/160430Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Leon Klingele authored
Change-Id: I429db8dca219fb931f7b05ce7a7324e8c4ba935b GitHub-Last-Rev: 2257a5bf23e7d79f54bedba2c2bed8c59bb6114c GitHub-Pull-Request: golang/go#29999 Reviewed-on: https://go-review.googlesource.com/c/160423Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Leon Klingele authored
Change-Id: I4a0d5b2f76138895567939920fa5d83cbdec17d2 GitHub-Last-Rev: 061d9d1d5655a6a9d8371f08d2f77a0ed7a495cc GitHub-Pull-Request: golang/go#30008 Reviewed-on: https://go-review.googlesource.com/c/160432Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Leon Klingele authored
Change-Id: I696da3b07c8b0a2802d3d1291f475e241e4ad90a GitHub-Last-Rev: df571ce03bd07a1e12203774f4c120f5017590f6 GitHub-Pull-Request: golang/go#30011 Reviewed-on: https://go-review.googlesource.com/c/160435Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
We were using t.Parallel in a subtest, which meant that the main test would not wait for the subtest, so the main test would delete the temporary directory before the subtest used it. The subtest worked because "go build -o /tmp/x/y/p.exe p" creates /tmp/x/y as needed. Updates #30500 Change-Id: I5904ecac748d15ded4cb609f049fa548b8916a0e Reviewed-on: https://go-review.googlesource.com/c/164857 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Leon Klingele authored
Change-Id: I8aaa3d1d2797f3ace34bc09f5123538f6a77efce GitHub-Last-Rev: 2758c462041ff5e444651b7927d53e809d2efe4d GitHub-Pull-Request: golang/go#30009 Reviewed-on: https://go-review.googlesource.com/c/160433Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Marat Khabibullin authored
The variable err could have nil value when we call err.Error(), because after we check it for nil above we continue the test (t.Errorf doesn't stop the test execution). Updates #30208 Change-Id: I6f7a8609f2453f622a1fa94a50c99d2e04d5fbcd GitHub-Last-Rev: 3a5d9b1e9e202327af17cc1b93bfa69f6701af84 GitHub-Pull-Request: golang/go#30215 Reviewed-on: https://go-review.googlesource.com/c/162477Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Samuel Kelemen authored
replaces broken link with a web.archive.org link. Change-Id: I438536a6ac51d837c30be5df7d3d0caadf65bb95 GitHub-Last-Rev: 0601e4d6b2440f7fb97a6700b74651dc16645c50 GitHub-Pull-Request: golang/go#30523 Reviewed-on: https://go-review.googlesource.com/c/164761Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
- 01 Mar, 2019 17 commits
-
-
Vladimir Varankin authored
The change makes it easier for a user to get to the page where she can check supported test flags, by adding 'go test testflag' reference to the 'go test -help' output. Fix #30365 Change-Id: I5b3db7853021ef68d096dcb467d7957d7e1bf623 GitHub-Last-Rev: ce3dec59fcae0cca232372f01cdda98773c290c0 GitHub-Pull-Request: golang/go#30420 Reviewed-on: https://go-review.googlesource.com/c/163858Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
Updates #30500 Change-Id: I42716c2bfd7f087303bc63d7518e32b52fd0d762 Reviewed-on: https://go-review.googlesource.com/c/164862 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
We were accidentally ignoring any error returned by poll.SendFile. Noticed by reading the code. It could only change behavior if the sendfile system call both wrote some bytes and returned an error. Change-Id: I0693d6ec0a30f5a86b78d38793899ca29fb9e156 Reviewed-on: https://go-review.googlesource.com/c/164760 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
Split TestMain into two functions so that we can defer cleanups. Updates #30500 Change-Id: I4a5c7ddb8218a8bd056c8733c3cb9feb895e77a0 Reviewed-on: https://go-review.googlesource.com/c/164859 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
-
Ian Lance Taylor authored
The deferred os.RemoveAll was accidentally committed as commented out in the original https://golang.org/cl/87158. Updates #30500 Change-Id: Idc5195816d7978253760dbfd78fde6d22c456296 Reviewed-on: https://go-review.googlesource.com/c/164858 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
-
Ian Lance Taylor authored
Split TestMain into two functions so that we can defer cleanups. Updates #30500 Change-Id: I1fa7957be0779c079ec4d221a8321b45ddb973e2 Reviewed-on: https://go-review.googlesource.com/c/164860 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
-
Bryan C. Mills authored
We mostly use shell variables for paths, and we don't want file paths like "C:\work\go1.4" to turn into regular expressions. Updates #30228 Updates #30241 Change-Id: If18b775b2f8b2821eaf197c4be4a322066af839f Reviewed-on: https://go-review.googlesource.com/c/164626 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
-
Elias Naur authored
Android now works with all.bash. Change-Id: I1087308865d2eb31f02501b5798e14d11145b185 Reviewed-on: https://go-review.googlesource.com/c/164700 Run-TryBot: Elias Naur <mail@eliasnaur.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Bryan C. Mills authored
That makes the test more friendly to the Android exec script, since it won't have to evaluate symlinks to find the directory. Change-Id: I06aae3224d489eed6d7fac7e462361f3bf1dd3da Reviewed-on: https://go-review.googlesource.com/c/164624 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Elias Naur <mail@eliasnaur.com>
-
Ian Lance Taylor authored
Ensure that cmd/go consistently calls base.Exit rather than os.Exit, so that we don't incorrectly leave the work directory around on exit. Test this by modifying the testsuite to run all the tests with TMPDIR set to a temporary directory, and then check that no files are left behind in that temporary directory. Adjust a couple of tests to make this approach work. Updates #30500 Updates https://gcc.gnu.org/PR89406 Change-Id: Ib6a5fc8a288a6cf4713022baa2b8dfefad62ba34 Reviewed-on: https://go-review.googlesource.com/c/163237 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Bryan C. Mills authored
Otherwise, if the working directory is inside a standard-library module, the test may try to fetch module contents from GOPROXY or upstream. Updates #26924 Updates #30228 Updates #30241 Change-Id: I4cb9a07721bd808fd094f7ed55a74cf7bce9cd6f Reviewed-on: https://go-review.googlesource.com/c/164625 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
-
Elias Naur authored
Previous CLs added symlink evaulation to GOROOT and GOPATH. Unfortunately that only fixed tests that ran outside GOROOT. To fix the standard library tests, evaluate symlinks in the current working directory as well. Change-Id: Ia406a968235ae4321a1002567520105998582d15 Reviewed-on: https://go-review.googlesource.com/c/164699 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Bryan C. Mills authored
These tests check for GOPATH-mode vendoring behavior, so make sure they're in GOPATH mode. Updates #30228 Change-Id: I646f59b67cb76dacd07adc3f6ed15ed63f4e22a4 Reviewed-on: https://go-review.googlesource.com/c/164620 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
-
Cherry Zhang authored
With stack objects, when we scan the stack, it scans defers with tracebackdefers, but it seems to me that tracebackdefers doesn't include the func value itself, which could be a stack allocated closure. Scan it explicitly. Alternatively, we can change tracebackdefers to include the func value, which in turn needs to change the type of stkframe. Fixes #30453. Change-Id: I55a6e43264d6952ab2fa5c638bebb89fdc410e2b Reviewed-on: https://go-review.googlesource.com/c/164118Reviewed-by: Keith Randall <khr@golang.org>
-
Vladimir Kuzmin authored
HTTP status code 103 (Early Hints) from RFC 8297. Fixes #29655 Change-Id: Ia1edbb561ee46f42d7fa1aae3ab9586497fcdb6c Reviewed-on: https://go-review.googlesource.com/c/157339 Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
artemkaxboy authored
Change-Id: Ia071f6914b3c155a88103f930af00028986ec8c7 Reviewed-on: https://go-review.googlesource.com/c/151019Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
erifan01 authored
On amd64 ReverseBytes16 is lowered to a rotate instruction. However arm64 doesn't have 16-bit rotate instruction, but has a REV16W instruction which can be used for ReverseBytes16. This CL adds a rule to turn the patterns like (x<<8) | (x>>8) (the type of x is uint16, and "|" can also be "^" or "+") to a REV16W instruction. Code: func reverseBytes16(i uint16) uint16 { return bits.ReverseBytes16(i) } Before: 0x0004 00004 (test.go:6) MOVHU "".i(FP), R0 0x0008 00008 ($GOROOT/src/math/bits/bits.go:262) UBFX $8, R0, $8, R1 0x000c 00012 ($GOROOT/src/math/bits/bits.go:262) ORR R0<<8, R1, R0 0x0010 00016 (test.go:6) MOVH R0, "".~r1+8(FP) 0x0014 00020 (test.go:6) RET (R30) After: 0x0000 00000 (test.go:6) MOVHU "".i(FP), R0 0x0004 00004 (test.go:6) REV16W R0, R0 0x0008 00008 (test.go:6) MOVH R0, "".~r1+8(FP) 0x000c 00012 (test.go:6) RET (R30) Benchmarks: name old time/op new time/op delta ReverseBytes-224 1.000000ns +- 0% 1.000000ns +- 0% ~ (all equal) ReverseBytes16-224 1.500000ns +- 0% 1.000000ns +- 0% -33.33% (p=0.000 n=9+10) ReverseBytes32-224 1.000000ns +- 0% 1.000000ns +- 0% ~ (all equal) ReverseBytes64-224 1.000000ns +- 0% 1.000000ns +- 0% ~ (all equal) Change-Id: I87cd41b2d8e549bf39c601f185d5775bd42d739c Reviewed-on: https://go-review.googlesource.com/c/157757Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-