- 31 Mar, 2016 4 commits
-
-
Dave Cheney authored
As a followup to CL 21296, avoid append operations when constructing the fields of a Type if the length is known beforehand This also includes some small scoping driveby cleanups, and a change to tointerface0 to avoid iterating over the field list twice. compilebench shows a very small reduction in allocations. name old time/op new time/op delta Template 364ms ± 5% 363ms ± 4% ~ (p=0.945 n=20+19) Unicode 182ms ±11% 185ms ±12% ~ (p=0.445 n=20+20) GoTypes 1.14s ± 2% 1.14s ± 3% ~ (p=0.221 n=20+20) Compiler 5.85s ± 2% 5.84s ± 2% ~ (p=0.369 n=20+20) name old alloc/op new alloc/op delta Template 56.7MB ± 0% 56.7MB ± 0% -0.04% (p=0.000 n=20+20) Unicode 38.3MB ± 0% 38.3MB ± 0% ~ (p=0.728 n=20+19) GoTypes 180MB ± 0% 180MB ± 0% -0.02% (p=0.000 n=20+20) Compiler 812MB ± 0% 812MB ± 0% -0.02% (p=0.000 n=19+20) name old allocs/op new allocs/op delta Template 482k ± 0% 480k ± 0% -0.34% (p=0.000 n=20+20) Unicode 377k ± 0% 377k ± 0% -0.04% (p=0.010 n=20+20) GoTypes 1.36M ± 0% 1.35M ± 0% -0.24% (p=0.000 n=20+20) Compiler 5.47M ± 0% 5.46M ± 0% -0.11% (p=0.000 n=20+18) Change-Id: Ibb4c40229fa3816acd8de98ba41d1571a2aabacf Reviewed-on: https://go-review.googlesource.com/21352Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Dave Cheney <dave@cheney.net>
-
Dave Cheney authored
Apply Robert's optimisation from CL 21241 to Type.Fields. The results are less impressive, possibly because of the makeup of the test data. name old time/op new time/op delta Template 365ms ± 5% 365ms ± 3% ~ (p=0.888 n=20+16) Unicode 182ms ±10% 180ms ± 9% ~ (p=0.883 n=20+20) GoTypes 1.14s ± 2% 1.13s ± 3% ~ (p=0.096 n=20+20) Compiler 5.74s ± 1% 5.76s ± 2% ~ (p=0.369 n=20+20) name old alloc/op new alloc/op delta Template 56.8MB ± 0% 56.7MB ± 0% -0.15% (p=0.000 n=19+20) Unicode 38.3MB ± 0% 38.3MB ± 0% -0.02% (p=0.006 n=20+19) GoTypes 180MB ± 0% 180MB ± 0% -0.13% (p=0.000 n=20+20) Compiler 805MB ± 0% 804MB ± 0% -0.05% (p=0.000 n=20+20) name old allocs/op new allocs/op delta Template 485k ± 0% 482k ± 0% -0.54% (p=0.000 n=19+20) Unicode 377k ± 0% 377k ± 0% -0.05% (p=0.005 n=20+20) GoTypes 1.37M ± 0% 1.36M ± 0% -0.53% (p=0.000 n=20+19) Compiler 5.42M ± 0% 5.41M ± 0% -0.21% (p=0.000 n=20+20) Change-Id: I6782659fadd605ce9931bf5c737c7058b96a29eb Reviewed-on: https://go-review.googlesource.com/21296Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Nigel Tao authored
Fixes #14522. As I said on that issue: ---- This is a progressive JPEG image. There are two dimensions of progressivity: spectral selection (variables zs and ze in scan.go, ranging in [0, 63]) and successive approximation (variables ah and al in scan.go, ranging in [0, 8), from LSB to MSB, although ah=0 implicitly means ah=8). For this particular image, there are three components, and the SOS markers contain this progression: zs, ze, ah, al: 0 0 0 0 components: 0, 1, 2 zs, ze, ah, al: 1 63 0 0 components: 1 zs, ze, ah, al: 1 63 0 0 components: 2 zs, ze, ah, al: 1 63 0 2 components: 0 zs, ze, ah, al: 1 10 2 1 components: 0 zs, ze, ah, al: 11 63 2 1 components: 0 zs, ze, ah, al: 1 10 1 0 components: 0 The combination of all of these is complete (i.e. spectra 0 to 63 and bits 8 exclusive to 0) for components 1 and 2, but it is incomplete for component 0 (the luma component). In particular, there is no data for component 0, spectra 11 to 63 and bits 1 exclusive to 0. The image/jpeg code, as of Go 1.6, waits until both dimensions are complete before performing the de-quantization, IDCT and copy to an *image.YCbCr. This is the "if zigEnd != blockSize-1 || al != 0 { ... continue }" code and associated commentary in scan.go. Almost all progressive JPEG images end up complete in both dimensions for all components, but this particular image is incomplete for component 0, so the Go code never writes anything to the Y values of the resultant *image.YCbCr, which is why the broken output is so dark (but still looks recognizable in terms of red and blue hues). My reading of the ITU T.81 JPEG specification (Annex G) doesn't explicitly say that this is a valid image, but it also doesn't rule it out. In any case, the fix is, for progressive JPEG images, to always reconstruct the decoded blocks (by performing the de-quantization, IDCT and copy to an *image.YCbCr), regardless of whether or not they end up complete. Note that, in Go, the jpeg.Decode function does not return until the entire image is decoded, so we still only want to reconstruct each block once, not once per SOS (Start Of Scan) marker. ---- A test image was also added, based on video-001.progressive.jpeg. When decoding that image, inserting a println("nComp, zs, ze, ah, al:", nComp, zigStart, zigEnd, ah, al) into decoder.processSOS in scan.go prints: nComp, zs, ze, ah, al: 3 0 0 0 1 nComp, zs, ze, ah, al: 1 1 5 0 2 nComp, zs, ze, ah, al: 1 1 63 0 1 nComp, zs, ze, ah, al: 1 1 63 0 1 nComp, zs, ze, ah, al: 1 6 63 0 2 nComp, zs, ze, ah, al: 1 1 63 2 1 nComp, zs, ze, ah, al: 3 0 0 1 0 nComp, zs, ze, ah, al: 1 1 63 1 0 nComp, zs, ze, ah, al: 1 1 63 1 0 nComp, zs, ze, ah, al: 1 1 63 1 0 In other words, video-001.progressive.jpeg contains 10 different scans. This little program below drops half of them (remembering to keep the "\xff\xd9" End of Image marker): ---- package main import ( "bytes" "io/ioutil" "log" ) func main() { sos := []byte{0xff, 0xda} eoi := []byte{0xff, 0xd9} src, err := ioutil.ReadFile("video-001.progressive.jpeg") if err != nil { log.Fatal(err) } b := bytes.Split(src, sos) println(len(b)) // Prints 11. dst := bytes.Join(b[:5], sos) dst = append(dst, eoi...) if err := ioutil.WriteFile("video-001.progressive.truncated.jpeg", dst, 0666); err != nil { log.Fatal(err) } } ---- The video-001.progressive.truncated.jpeg was converted to png via libjpeg and ImageMagick: djpeg -nosmooth video-001.progressive.truncated.jpeg > tmp.tga convert tmp.tga video-001.progressive.truncated.png rm tmp.tga Change-Id: I72b20cd4fb6746d36d8d4d587f891fb3bc641f84 Reviewed-on: https://go-review.googlesource.com/21062Reviewed-by: Rob Pike <r@golang.org>
-
Dave Cheney authored
In tostruct0 and tofunargs we take a list of nodes, transform them into a slice of Fields, set the fields on a type, then use the IterFields iterator to iterate over the list again to see if any of them are broken. As we know the slice of fielde-we just created it-we can combine these two interations into one pass over the fields. Change-Id: I8b04c90fb32fd6c3b1752cfc607128a634ee06c5 Reviewed-on: https://go-review.googlesource.com/21350Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 30 Mar, 2016 32 commits
-
-
Matthew Dempsky authored
This allows us to get rid of Isptr and Issigned. Still some code to clean up for Isint, Isfloat, and Iscomplex. CL produced mechanically using gofmt -w -r. Passes toolstash -cmp. Change-Id: If4f807bb7f2b357288d2547be2380eb511875786 Reviewed-on: https://go-review.googlesource.com/21339 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Matthew Dempsky authored
CL produced mechanically using gofmt -w -r. Passes toolstash -cmp. Change-Id: Ib2e8710ebd844e2149125b41c335b71a02fcab53 Reviewed-on: https://go-review.googlesource.com/21338 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Alexandru Moșoi authored
* This is an improved version of an earlier patch. * Verified with gcc up to 100. * Limited to two instructions based on costs from https://gmplib.org/~tege/x86-timing.pdf Change-Id: Ib7c37de6fd8e0ba554459b15c7409508cbcf6728 Reviewed-on: https://go-review.googlesource.com/21103Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Replace Isfixedarray, Isslice, and Isinter with the IsArray, IsSlice, and IsInterface methods added for SSA. Rewrite performed mechanically using gofmt -w -r "Isfoo(t) -> t.IsFoo()". Because the IsFoo methods panic when given a nil pointer, a handful of call sites had to be modified to check for nil Type values. These aren't strictly necessary, because nil Type values should only occur in invalid Go source programs, so it would be okay if we panicked on them and gave up type checking the rest of the package. However, there are a couple regress tests that expect we continue, so add checks to keep those tests passing. (See #15029.) Passes toolstash -cmp. Change-Id: I511c6ac4cfdf3f9cbdb3e52a5fa91b6d09d82f80 Reviewed-on: https://go-review.googlesource.com/21336Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
Apparently I’m having a hard time following my own naming scheme. Change-Id: I99c801bef09fa65c1f0e8ecc2fba154a495e9c17 Reviewed-on: https://go-review.googlesource.com/21332Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
This removes almost all direct access to Type’s heavily overloaded Type field. Mostly generated by eg, manually checked. Significant manual changes: * reflect.go's typPkg used Type indiscriminately. Use it only for specific etypes. * gen.go's visitComponents contained a usage of Type with structs. Using Type for structs no longer occurs, and the Fatal contained therein has not triggered, so it has been axed. * Scary code in cgen.go's cgen_slice is now explicitly scary. Passes toolstash -cmp. Change-Id: I2dbfb3c959da7ae239f964d83898c204affcabc6 Reviewed-on: https://go-review.googlesource.com/21331Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
Also, add two uses of Key and Val that I missed earlier. As before, direct writes to Down and Type remain in bimport. Change-Id: I487aa975926b30092db1ad74ace17994697117c1 Reviewed-on: https://go-review.googlesource.com/21330Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Alexandru Moșoi authored
Change-Id: Ib2890ab1983cbef7c1c1ee5a10204ba3ace19b53 Reviewed-on: https://go-review.googlesource.com/21312 Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Brad Fitzpatrick authored
Partial revert of https://golang.org/cl/20967 which I can't reproduce and actually breaks me more. Fixes #14901 Change-Id: I8cce443fbd95f5f6f2a5b6a4b9f2faab36167a12 Reviewed-on: https://go-review.googlesource.com/21292 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Matthew Dempsky authored
Previously, t.IsPtr() reported whether t was represented with a pointer, but some of its callers expected it to report whether t is an actual Go pointer. Resolve this by renaming t.IsPtr to t.IsPtrShaped and adding a new t.IsPtr method to report Go pointer types. Updated a couple callers in gc/ssa.go to use IsPtr instead of IsPtrShaped. Passes toolstash -cmp. Updates #15028. Change-Id: I0a8154b5822ad8a6ad296419126ad01a3d2a5dc5 Reviewed-on: https://go-review.googlesource.com/21232Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Josh Bleecher Snyder authored
Passes toolstash -cmp. Change-Id: I721348ed2122b6a9cd87ad2041b6ee3bf6b2bbb5 Reviewed-on: https://go-review.googlesource.com/21306Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Passes toolstash -cmp. Change-Id: I7dffd9bc5bab323590df6fb591bf1e73edf2e465 Reviewed-on: https://go-review.googlesource.com/21305Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Passes toolstash -cmp. Change-Id: I2c71882f957c44047c7ac83c78236dcc3dfa15a1 Reviewed-on: https://go-review.googlesource.com/21304Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
Changes generated by eg and manually checked. Isfixedarray, Isslice, and many other Type-related functions in subr.go should either be deleted or moved to type.go. Later, though; the game now is cleanup via encapsulation. Passes toolstash -cmp. Change-Id: I83dd8816f6263b74367d23c2719a08c362e330f9 Reviewed-on: https://go-review.googlesource.com/21303Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Alexandru Moșoi authored
Happens occasionally for boolean phis was used as a control. Change-Id: Ie0f2483e9004c1706751d8dfb25ee2e5106d917e Reviewed-on: https://go-review.googlesource.com/21310 Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Joe Tsai authored
The Read logic should not assume that only (0, io.EOF) is returned instead of (n, io.EOF) where n is positive. The fix done here is very similar to the fix to compress/zlib in CL/20292. Change-Id: Icb76258cdcf8cfa386a60bab330fefde46fc071d Reviewed-on: https://go-review.googlesource.com/21308Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
kortschak authored
Fixes #14929. Change-Id: I0391acf9f5f65389f73637533306a7c4240320b8 Reviewed-on: https://go-review.googlesource.com/21295Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Joe Tsai authored
It is valid for io.Reader to return (n, io.EOF) where n is positive. The unit test should not fail if io.EOF is returned when read until the end. Change-Id: I7b918e3cc03db8b90c8aa58f4c0f7806a1d4af7e Reviewed-on: https://go-review.googlesource.com/21307Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Munday authored
s390x doesn't introduce any new assembly syntax. There are a few instructions which require the operands to be reordered, notably the storage-storage instructions that put the length into From3 so that the memory operands can be put into From and To. The assembly test currently covers a subset of instructions but tries to hit edge cases as much as possible. Unlike the other ports it can be linked as an executable to make disassembling it easy. It would be nice to autogenerate it at some point in the future. Change-Id: I8dd542c34b9e450b8129d46693a5acb0ded791ce Reviewed-on: https://go-review.googlesource.com/21253Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Josh Bleecher Snyder authored
substAny needs access to many internal details of gc.Type. substArgTypes comes along for the ride. Change-Id: I430a4edfd54a1266522f7a9818e5e7b5da72479c Reviewed-on: https://go-review.googlesource.com/21250Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Michael Munday authored
Change-Id: I4ed33f3fdb9ad5f0f8984d3ef282c34e26eb2cde Reviewed-on: https://go-review.googlesource.com/21301Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Michael Munday authored
Based on the ppc64 port. s390x supports 2, 4 and 6 byte instructions and Go assembly instructions sometimes map to several s390x instructions. The assembler loops until a fixed point is reached in order to use branch instructions that can only handle a short offset in a similar way to other ports. Change-Id: I4278bf46aca35a96ca9cea0857e6229643c9c1e3 Reviewed-on: https://go-review.googlesource.com/20942Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Keith Randall authored
Previously if we were only using the low bits of AuxInt, the high bits were ignored and could be junk. This CL changes that behavior to define the high bits to be the sign-extended version of the low bits for all cases. There are 2 main benefits: - Deterministic representation. This helps with CSE. (Const8 [0x1]) and (Const8 [0x101]) used to be the same "value" but CSE couldn't see them as such. - Testability. We can check that all ops leave AuxInt in a state consistent with the new rule. In the old scheme, it was hard to check whether a rule correctly used only the low-order bits. Side benefits: - ==0 and !=0 tests are easier. Drawbacks: - This differs from the runtime representation in registers, where it is important that we allow upper bits to be undefined (so we're not sign/zero-extending all the time). - Ops that treat AuxInt as unsigned (shifts, mostly) need to be a bit more careful. Change-Id: I9a685ff27e36dc03287c9ab1cecd6c0b4045c819 Reviewed-on: https://go-review.googlesource.com/21256Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
-
Brad Fitzpatrick authored
Flip around the composition order of the http.Response.Body's gzip.Reader vs. the reader which keeps track of waiting to see the end of the HTTP/1 response framing (whether that's a Content-Length or HTTP/1.1 chunking). Previously: user -> http.Response.Body -> bodyEOFSignal -> gzipReader -> gzip.Reader -> bufio.Reader [ -> http/1.1 de-chunking reader ] optional -> http1 framing *body But because bodyEOFSignal was waiting to see an EOF from the underlying gzip.Reader before reusing the connection, and gzip.Reader (or more specifically: the flate.Reader) wasn't returning an early io.EOF with the final chunk, the bodyEOfSignal was never releasing the connection, because the EOF from the http1 framing was read by a party who didn't care about it yet: the helper bufio.Reader created to do byte-at-a-time reading in the flate.Reader. Flip the read composition around to: user -> http.Response.Body -> gzipReader -> gzip.Reader -> bufio.Reader -> bodyEOFSignal [ -> http/1.1 de-chunking reader ] optional -> http1 framing *body Now when gzip.Reader does its byte-at-a-time reading via the bufio.Reader, the bufio.Reader will do its big reads against the bodyEOFSignal reader instead, which will then see the underlying http1 framing EOF, and be able to reuse the connection. Updates google/go-github#317 Updates #14867 And related abandoned fix to flate.Reader: https://golang.org/cl/21290 Change-Id: I3729dfdffe832ad943b84f4734b0f59b0e834749 Reviewed-on: https://go-review.googlesource.com/21291Reviewed-by: David Symonds <dsymonds@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Shahar Kohanim authored
Record total number of relocations, pcdata, automatics, funcdata and files in object file and use these numbers in the linker to allocate contiguous slices to later be filled by the defined symbols. name old secs new secs delta LinkCmdGo 0.52 ± 3% 0.49 ± 3% -4.21% (p=0.000 n=91+92) LinkJuju 4.48 ± 4% 4.21 ± 7% -6.08% (p=0.000 n=96+100) name old MaxRSS new MaxRSS delta LinkCmdGo 122k ± 2% 120k ± 4% -1.66% (p=0.000 n=98+93) LinkJuju 799k ± 5% 865k ± 8% +8.29% (p=0.000 n=89+99) GOGC=off name old secs new secs delta LinkCmdGo 0.42 ± 2% 0.41 ± 0% -2.98% (p=0.000 n=89+70) LinkJuju 3.61 ± 0% 3.52 ± 1% -2.46% (p=0.000 n=80+89) name old MaxRSS new MaxRSS delta LinkCmdGo 130k ± 1% 128k ± 1% -1.33% (p=0.000 n=100+100) LinkJuju 1.00M ± 0% 0.99M ± 0% -1.70% (p=0.000 n=100+100) Change-Id: Ie08f6ccd4311bb78d8950548c678230a58635c73 Reviewed-on: https://go-review.googlesource.com/21026Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
Fixes bug I introduced in CL 21202. Fixes #15013. Change-Id: I2344d7e22b8273425a0a56f4a77588b5c6e4d8c6 Reviewed-on: https://go-review.googlesource.com/21270 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Austin Clements authored
Change-Id: I5217bf4b75e110ca2946e1abecac6310ed84dad5 Reviewed-on: https://go-review.googlesource.com/21205 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Rick Hudson <rlh@golang.org>
-
Alex Brainman authored
Fixes #14859 Change-Id: I262d634ee22498ec9855d273afdd409149765294 Reviewed-on: https://go-review.googlesource.com/21195Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Philip Hofer authored
The CMP* family of instructions are longer than their TEST counterparts by one byte. After this change, my go tool has 13 cmp.*$0x0 instructions, compared to 5612 before. Change-Id: Ieb87d65657917e494c0e4b711a7ba2918ae27610 Reviewed-on: https://go-review.googlesource.com/21255Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Martin Möhrmann authored
Fixes #14924 Change-Id: I098ef973e2cad76a121704492758c2971a9b55f3 Reviewed-on: https://go-review.googlesource.com/20920 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Martin Möhrmann authored
Simplify the handling of zero padding in fmt_integer and fmt_float to not require any adjustment of the format flags. Note that f.zero can only be true when padding to the left and f.wid is always greater than or equal to 0. Change-Id: I204b57d103c0eac13d86995992f2b26209196925 Reviewed-on: https://go-review.googlesource.com/21185 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Aliaksandr Valialkin authored
Updates #14839 Fixes #14994 Change-Id: I9bb51bad19105a17c80d690c5486e5dd007ac84a Reviewed-on: https://go-review.googlesource.com/21222 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
- 29 Mar, 2016 4 commits
-
-
Josh Bleecher Snyder authored
These are the first of several convenience constructors for types. They are part of type field encapsulation. This removes most external writes to TARRAY Type and Bound fields. substAny still directly fiddles with the .Type field. substAny generally needs access to Type internals. It will be moved to type.go in a future CL. bimport still directly writes the .Type field. This is hard to change. Also of note: * inl.go contains an (apparently irrelevant) bug fix: as.Right was given the wrong type. vararrtype was previously unused. * I believe that aindex (subr.go) never creates slices, but it is safer to keep existing behavior. The removal of -1 as a constant there is part of hiding that implementation detail. Future CLs will finish that job. Passes toolstash -cmp. Change-Id: If09bf001a874d7dba08e9ad0bcd6722860af4b91 Reviewed-on: https://go-review.googlesource.com/21249Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Josh Bleecher Snyder authored
defaultlit and friends sometimes create a new OLITERAL node, only to have replace it. Thread hints when that is unnecessary. name old time/op new time/op delta Template 318ms ± 6% 322ms ± 4% ~ (p=0.154 n=24+25) Unicode 162ms ± 6% 151ms ± 7% -6.94% (p=0.000 n=22+23) GoTypes 1.04s ± 1% 1.04s ± 3% ~ (p=0.136 n=20+25) Compiler 5.08s ± 2% 5.10s ± 4% ~ (p=0.788 n=25+25) MakeBash 41.4s ± 1% 41.5s ± 1% ~ (p=0.084 n=25+25) name old user-ns/op new user-ns/op delta Template 438M ±10% 441M ± 9% ~ (p=0.418 n=25+25) Unicode 272M ± 5% 219M ± 5% -19.33% (p=0.000 n=24+21) GoTypes 1.51G ± 3% 1.51G ± 3% ~ (p=0.500 n=25+25) Compiler 7.31G ± 3% 7.32G ± 3% ~ (p=0.572 n=25+24) name old alloc/op new alloc/op delta Template 57.3MB ± 0% 57.2MB ± 0% -0.16% (p=0.000 n=25+25) Unicode 41.1MB ± 0% 38.7MB ± 0% -5.81% (p=0.000 n=25+25) GoTypes 191MB ± 0% 191MB ± 0% -0.06% (p=0.000 n=25+25) Compiler 840MB ± 0% 839MB ± 0% -0.12% (p=0.000 n=25+25) name old allocs/op new allocs/op delta Template 500k ± 0% 500k ± 0% -0.12% (p=0.000 n=24+25) Unicode 400k ± 0% 384k ± 0% -4.16% (p=0.000 n=25+25) GoTypes 1.50M ± 0% 1.49M ± 0% -0.05% (p=0.000 n=25+25) Compiler 6.04M ± 0% 6.03M ± 0% -0.11% (p=0.000 n=25+25) Change-Id: I2fda5e072db67ba239848bde827c7deb2ad4abae Reviewed-on: https://go-review.googlesource.com/20813Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Aliaksandr Valialkin authored
Previously format argument was detected via scanning func type args. This didn't work when func type couldn't be determined if the func is declared in the external package. Fall back to scanning for the first string call argument in this case. Fixes #14754 Change-Id: I571cc29684cc641bc87882002ef474cf1481e9e2 Reviewed-on: https://go-review.googlesource.com/21023 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Michael Munday authored
Change-Id: I8440f69c7f99d65b2f69035c26b4a62104f22bd3 Reviewed-on: https://go-review.googlesource.com/20874Reviewed-by: Minux Ma <minux@golang.org>
-