- 15 Dec, 2015 8 commits
-
-
Austin Clements authored
Change-Id: I5e6739ff0c6c561195ed9891fb90f933b81e7750 Reviewed-on: https://go-review.googlesource.com/17746 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Russ Cox <rsc@golang.org>
-
Austin Clements authored
deductSweepCredit expects the size in bytes of the span being allocated, but mCentral_CacheSpan passes the size of a single object in the span. As a result, we don't sweep enough on that call and when mCentral_CacheSpan later calls reimburseSweepCredit, it's very likely to underflow mheap_.spanBytesAlloc, which causes the next call to deductSweepCredit to think it owes a huge number of pages and finish off the whole sweep. In addition to causing the occasional allocation that triggers the full sweep to be potentially extremely expensive relative to other allocations, this can indirectly slow down many other allocations. deductSweepCredit uses sweepone to sweep spans, which returns fully-unused spans to the heap, where these spans are freed and coalesced with neighboring free spans. On the other hand, when mCentral_CacheSpan sweeps a span, it does so with the intent to immediately reuse that span and, as a result, will not return the span to the heap even if it is fully unused. This saves on the cost of locking the heap, finding a span, and initializing that span. For example, before this change, with GOMAXPROCS=1 (or the background sweeper disabled) BinaryTree17 returned roughly 220K spans to the heap and allocated new spans from the heap roughly 232K times. After this change, it returns 1.3K spans to the heap and allocates new spans from the heap 39K times. (With background sweeping these numbers are effectively unchanged because the background sweeper sweeps almost all of the spans with sweepone; however, parallel sweeping saves more than the cost of allocating spans from the heap.) Fixes #13535. Fixes #13589. name old time/op new time/op delta BinaryTree17-12 3.03s ± 1% 2.86s ± 4% -5.61% (p=0.000 n=18+20) Fannkuch11-12 2.48s ± 1% 2.49s ± 1% ~ (p=0.060 n=17+20) FmtFprintfEmpty-12 50.7ns ± 1% 50.9ns ± 1% +0.43% (p=0.025 n=15+16) FmtFprintfString-12 174ns ± 2% 174ns ± 2% ~ (p=0.539 n=19+20) FmtFprintfInt-12 158ns ± 1% 158ns ± 1% ~ (p=0.300 n=18+20) FmtFprintfIntInt-12 269ns ± 2% 269ns ± 2% ~ (p=0.784 n=20+18) FmtFprintfPrefixedInt-12 233ns ± 1% 234ns ± 1% ~ (p=0.389 n=18+18) FmtFprintfFloat-12 309ns ± 1% 310ns ± 1% +0.25% (p=0.048 n=18+18) FmtManyArgs-12 1.10µs ± 1% 1.10µs ± 1% ~ (p=0.259 n=18+19) GobDecode-12 7.81ms ± 1% 7.72ms ± 1% -1.17% (p=0.000 n=19+19) GobEncode-12 6.56ms ± 0% 6.55ms ± 1% ~ (p=0.433 n=17+19) Gzip-12 318ms ± 2% 317ms ± 1% ~ (p=0.578 n=19+18) Gunzip-12 42.1ms ± 2% 42.0ms ± 0% -0.45% (p=0.007 n=18+16) HTTPClientServer-12 63.9µs ± 1% 64.0µs ± 1% ~ (p=0.146 n=17+19) JSONEncode-12 16.4ms ± 1% 16.4ms ± 1% ~ (p=0.271 n=19+19) JSONDecode-12 58.1ms ± 1% 58.0ms ± 1% ~ (p=0.152 n=18+18) Mandelbrot200-12 3.85ms ± 0% 3.85ms ± 0% ~ (p=0.126 n=19+18) GoParse-12 3.71ms ± 1% 3.64ms ± 1% -1.86% (p=0.000 n=20+18) RegexpMatchEasy0_32-12 100ns ± 2% 100ns ± 1% ~ (p=0.588 n=20+20) RegexpMatchEasy0_1K-12 346ns ± 1% 347ns ± 1% +0.27% (p=0.014 n=17+20) RegexpMatchEasy1_32-12 82.9ns ± 3% 83.5ns ± 3% ~ (p=0.096 n=19+20) RegexpMatchEasy1_1K-12 506ns ± 1% 506ns ± 1% ~ (p=0.530 n=19+19) RegexpMatchMedium_32-12 129ns ± 2% 129ns ± 1% ~ (p=0.566 n=20+19) RegexpMatchMedium_1K-12 39.4µs ± 1% 39.4µs ± 1% ~ (p=0.713 n=19+20) RegexpMatchHard_32-12 2.05µs ± 1% 2.06µs ± 1% +0.36% (p=0.008 n=18+20) RegexpMatchHard_1K-12 61.6µs ± 1% 61.7µs ± 1% ~ (p=0.286 n=19+20) Revcomp-12 538ms ± 1% 541ms ± 2% ~ (p=0.081 n=18+19) Template-12 71.5ms ± 2% 71.6ms ± 1% ~ (p=0.513 n=20+19) TimeParse-12 357ns ± 1% 357ns ± 1% ~ (p=0.935 n=19+18) TimeFormat-12 352ns ± 1% 352ns ± 1% ~ (p=0.293 n=19+20) [Geo mean] 62.0µs 61.9µs -0.21% name old time/op new time/op delta XBenchGarbage-12 5.83ms ± 2% 5.86ms ± 3% ~ (p=0.247 n=19+20) Change-Id: I790bb530adace27ccf25d372f24a11954b88443c Reviewed-on: https://go-review.googlesource.com/17745 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Péter Szilágyi authored
Analogous to https://go-review.googlesource.com/#/c/8457/ this code synthesizes an set of program arguments for Android on the arm64 architecture. Change-Id: I851958b4b0944ec79d7a1426a3bb2cfc31746797 Reviewed-on: https://go-review.googlesource.com/17782Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Alex Brainman authored
Otherwise it's hard to tell the difference between link1 and link2 or other tests. Change-Id: I36c153cccb10959535595938dfbc49db930b9fac Reviewed-on: https://go-review.googlesource.com/17851Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Updates bundled copy of x/net/http2 to include https://golang.org/cl/17823 (catching panics in Handlers) Fixes #13555 Change-Id: I08e4e38e736a8d93f5ec200e8041c143fc6eafce Reviewed-on: https://go-review.googlesource.com/17824Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Fixes #10912 Change-Id: If04e3205d5cc43ebfd6864bc59340c8697cbc0af Reviewed-on: https://go-review.googlesource.com/17592 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Burcu Dogan authored
Change-Id: I3533b557cd6c7127ab4efbe8766184b51ce260c9 Reviewed-on: https://go-review.googlesource.com/17768Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
Burcu Dogan authored
Change-Id: Id511855da1c663250a4ffb149277a3f4a7f38360 Reviewed-on: https://go-review.googlesource.com/17766Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 14 Dec, 2015 17 commits
-
-
Robert Griesemer authored
Use two internal representations for Float values (similar to what is done for Int values). Transparently switch to a big.Float representation when big.Rat values become unwieldy. This is almost never needed for real-world programs but it is trivial to create test cases that cannot be handled with rational arithmetic alone. As a consequence, the go/constant API semantics changes slightly: Until now, a value could always be represented in its "smallest" form (e.g., float values that happened to be integers would be represented as integers). Now, constant Kind depends on how the value was created, rather than its actual value. (The reason why we cannot automatically "normalize" values to their smallest form anymore is because floating-point numbers are not exact in general; and thus normalization is often not possible in the first place, or would throw away precision when it is not desired.) This has repercussions as to how constant Values are used go/types and required corresponding adjustments. Details of the changes: go/constant package: - use big.Rat and big.Float values to represent floating-point values (internal change) - changed semantic of Value.Kind accordingly - String now returns a short, human-readable form of a value (this leads to better error messages in go/types) - added ToInt, ToFloat, and ToComplex conversion functions - added ExactString to obtain an exact string form of a value go/types: - adjusted and simplified implementation of representableConst - adjusted various places where Value.Kind was expected to be "smallest" by calling the respective ToInt/Float/Complex conversion functions - enabled 5 disabled tests in stdlib_test.go that now work api checker: - print all constant values in a short human-readable form (floats are printed in floating-point form), but also print an exact form if it is different from the short form - adjusted test golden file and go.1.1.text reference file Fixes #11327. Change-Id: I492b704aae5b0238e5b7cee13e18ffce61193587 Reviewed-on: https://go-review.googlesource.com/17360Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
This CL also updates the bundled http2 package with the h2 fix from https://golang.org/cl/17757 Fixes #13159 Change-Id: If0e3b4bd04d0dceed67d1b416ed838c9f1961576 Reviewed-on: https://go-review.googlesource.com/17758Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Rahul Chaudhry authored
TestLchown was creating a hard-link instead of a symlink. It would have passed if you replaced all Lchown() calls in it with Chown(). Change-Id: I3a108948ec25fcbac8ea890a6eaf5bac094f0800 Reviewed-on: https://go-review.googlesource.com/17397 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Matthew Dempsky authored
Followup to CL 17716, which updated cgo's boilerplate prologue code to use standard C's _Complex instead of GCC's __complex extension. Change-Id: I74f29b0cc3d13cab2853441cafbfe77853bba4f9 Reviewed-on: https://go-review.googlesource.com/17820 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Austin Clements authored
To prevent races with the garbage collector, stack spans cannot be reused as heap spans during a GC. We deal with this by caching stack spans during GC and releasing them at the end of mark termination. However, while our cache lets us reuse small stack spans, currently large stack spans are *not* reused. This can cause significant memory growth in programs that allocate large stacks rapidly, but grow the heap slowly (such as in issue #13552). Fix this by adding logic to reuse large stack spans for other stacks. Fixes #11466. Fixes #13552. Without this change, the program in this issue creeps to over 1GB of memory over the course of a few hours. With this change, it stays rock solid at around 30MB. Change-Id: If8b2d85464aa80c96230a1990715e39aa803904f Reviewed-on: https://go-review.googlesource.com/17814Reviewed-by: Keith Randall <khr@golang.org>
-
Russ Cox authored
These three files contain only code written for Go (and trivial amounts at that), not any code ported from Inferno or Plan 9. Remove the incorrect Inferno/Plan 9 notices. Fixes #13576. Change-Id: Ib9901fb360232282aae5ee0f4aa527bd6f4eaaed Reviewed-on: https://go-review.googlesource.com/17779Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Brad Fitzpatrick authored
Fixes #13610 Change-Id: I9c8f924dc1ad515a9697291e981ece34fdbec8b7 Reviewed-on: https://go-review.googlesource.com/17755 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
I thought that we avoided creating on-disk Unix sockets, but I was mistaken. Use one to test CL 17458. Fixes #11826. Change-Id: Iaa1fb007b95fa6be48200586522a6d4789ecd346 Reviewed-on: https://go-review.googlesource.com/17725 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Updates #13385 Change-Id: I9c2edf8c02adc388c48760b29e63dfa2966262d6 Reviewed-on: https://go-review.googlesource.com/17532Reviewed-by: Tim Cooijmans <timcooijmans@gmail.com> Reviewed-by: Adam Langley <agl@golang.org>
-
Brad Fitzpatrick authored
Updates to x/net git rev 6c105c0a Fixes #13598 Change-Id: I207d4c78d744f0fd83cb5acd8bd6e5987e59a4f7 Reviewed-on: https://go-review.googlesource.com/17756 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
(instead of using a GCC extension). Change-Id: I110dc45bfe5f1377fe3453070eccde283b5cc161 Reviewed-on: https://go-review.googlesource.com/17716Reviewed-by: Russ Cox <rsc@golang.org>
-
Alex Brainman authored
Fixes #13582 Change-Id: I220f3c7b9511b3c080874f5c42f2a431fdddcbb7 Reviewed-on: https://go-review.googlesource.com/17794 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
Change-Id: Iae2bf44ec15975f440d026fd52fcccfbd9c598d9 Reviewed-on: https://go-review.googlesource.com/17740Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
New implementation of TimeoutHandler: buffer everything to memory. All or nothing: either the handler finishes completely within the timeout (in which case the wrapper writes it all), or it misses the timeout and none of it gets written, in which case handler wrapper can reliably print the error response without fear that some of the wrapped Handler's code already wrote to the output. Now the goroutine running the wrapped Handler has its own write buffer and Header copy. Document the limitations. Fixes #9162 Change-Id: Ia058c1d62cefd11843e7a2fc1ae1609d75de2441 Reviewed-on: https://go-review.googlesource.com/17752Reviewed-by: David Symonds <dsymonds@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
Mikio Hara authored
Change-Id: I064a7e21bdc55d7f72147bcf6cfb91b96dbb77bb Reviewed-on: https://go-review.googlesource.com/17795Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
-
Mikio Hara authored
At present, the series of File{Conn,Listener,PacketConn} APIs are the only way to configure platform-specific socket options such as SO_REUSE{ADDR,PORT}, TCP_FASTOPEN. This change adds missing test cases that test read and write operations on connections created by File APIs and removes redundant parameter tests which are already tested in server_test.go. Also adds comment on full stack test cases for IPConn. Fixes #10730. Change-Id: I67abb083781b602e876f72a6775a593c0f363c38 Reviewed-on: https://go-review.googlesource.com/17476Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Emmanuel Odeke authored
Change-Id: Ic639443d4a8536dd54c5b0cf5a9b6d1474448f77 Reviewed-on: https://go-review.googlesource.com/17593Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 12 Dec, 2015 1 commit
-
-
Matthew Dempsky authored
Copying return values to heap-escaped result parameters requires write barriers. Fixes #13587. Change-Id: Ifa04ff7fa4adcc6393acdd82e527beb8f2a00a8b Reviewed-on: https://go-review.googlesource.com/17762Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 11 Dec, 2015 13 commits
-
-
Sameer Ajmani authored
Change-Id: I88fea011e68a8f0d351d2a9dd81d6aa48bc7c7c7 Reviewed-on: https://go-review.googlesource.com/17731Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
Fixes #13515. Change-Id: I7dd5fbc816e5ea135f7d81f6735e7601f636fe4f Reviewed-on: https://go-review.googlesource.com/17672Reviewed-by: Robert Griesemer <gri@golang.org>
-
Russ Cox authored
Change-Id: I97d2315a1f978fbc4fd9e7f5f860f8e29ae43470 Reviewed-on: https://go-review.googlesource.com/17743Reviewed-by: Russ Cox <rsc@golang.org>
-
David Chase authored
Replaced code that substituted 0 for rounded-up 1 with code to try again. This has minimal effect on the existing stream of random numbers, but restores uniformity. Fixes #12290. Change-Id: Ib68f0b0a4a173339bcd0274cc16509f7b0977de8 Reviewed-on: https://go-review.googlesource.com/17670Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
This file is not part of the benchmark shootout, and we wrote it, so use the usual copyright header, not a partial version of the shootout license. Fixes #13575. Change-Id: Ib610e2ad82914b4ef096a2424cfffe3383db2d5b Reviewed-on: https://go-review.googlesource.com/17715 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Dmitry Vyukov authored
Currently we wake up new worker threads whenever we pass through the scheduler with nmspinning==0. This leads to lots of unnecessary thread wake ups. Instead let only spinning threads wake up new spinning threads. For the following program: package main import "runtime" func main() { for i := 0; i < 1e7; i++ { runtime.Gosched() } } Before: $ time ./test real 0m4.278s user 0m7.634s sys 0m1.423s $ strace -c ./test % time seconds usecs/call calls errors syscall 99.93 9.314936 3 2685009 17536 futex After: $ time ./test real 0m1.200s user 0m1.181s sys 0m0.024s $ strace -c ./test % time seconds usecs/call calls errors syscall 3.11 0.000049 25 2 futex Fixes #13527 Change-Id: Ia1f5bf8a896dcc25d8b04beb1f4317aa9ff16f74 Reviewed-on: https://go-review.googlesource.com/17540Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Dmitry Vyukov <dvyukov@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Russ Cox authored
Change-Id: I26fc120e66f559e4da90883ed5c8457a99426a25 Reviewed-on: https://go-review.googlesource.com/17729Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
This change can break real code. There are other newline-related bugs in this code, and fixing them will also break real code. If we're going to break real code, let's fix all the bugs together and just break things once. This reverts commit 8331f19d. Change-Id: Ie4b3022f3a305c3e1f78cc208e50beed212608e6 Reviewed-on: https://go-review.googlesource.com/17724Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
The meaning of DeepEqual has never been specified. Do that. Also fix bug involving maps with NaN keys. Except for the map bug fix, there should be no semantic changes here. Fixes #12025. Change-Id: Ied562cf543a22ec645d42bdb9b41d451c16b1f21 Reviewed-on: https://go-review.googlesource.com/17450Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org>
-
Russ Cox authored
Host names in URLs must not use %-escaping for ASCII bytes, per RFC 3986. url.Parse has historically allowed spaces and < > " in the URL host. In Go 1.5, URL's String method started escaping those, but then Parse would rejects the escaped form. This CL is an attempt at some consistency between Parse and String as far as the accepted host characters and the encoding of host characters, so that if Parse succeeds, then Parse -> String -> Parse also succeeds. Allowing space seems like a mistake, so reject that in Parse. (Similarly, reject \t, \x01, and so on, all of which were being allowed.) Allowing < > " doesn't seem awful, so continue to do that, and go back to the Go 1.4 behavior of not escaping them in String. Fixes #11302. Change-Id: I0bf65b874cd936598f20694574364352a5abbe5f Reviewed-on: https://go-review.googlesource.com/17387Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Russ Cox authored
Fixes #11826. Change-Id: Id220dd558ca8d8d78c01975087122d27757deea0 Reviewed-on: https://go-review.googlesource.com/17458Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Rahul Chaudhry authored
debug.schedtrace is an int32. Convert it to int64 before multiplying with constant 1000000. Otherwise, schedtrace values more than 2147 result in int32 overflow causing incorrect delays between traces. Change-Id: I064e8d7b432c1e892a705ee1f31a2e8cdd2c3ea3 Reviewed-on: https://go-review.googlesource.com/17712Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
ˆ (U+02C6) is a circumflex accent, not an exponentiation operator. In the rest of the source code for this package, exponentation is written as **, so do the same here. Change-Id: I107b85be242ab79d152eb8a6fcf3ca2b197d7658 Reviewed-on: https://go-review.googlesource.com/17671Reviewed-by: Robert Griesemer <gri@golang.org>
-
- 10 Dec, 2015 1 commit
-
-
Brad Fitzpatrick authored
Fixes #13569 Change-Id: I04c9a44437414177e2fee260518cfe53a67e6364 Reviewed-on: https://go-review.googlesource.com/17684Reviewed-by: Rob Pike <r@golang.org>
-