]>
Cypherpunks repositories - gostls13.git/log
Benny Siegert [Mon, 4 Jun 2012 15:29:34 +0000 (01:29 +1000)]
syscall: use pipe instead of pipe2 on NetBSD
pipe2 is equivalent to pipe with flags set to 0.
However, pipe2 was only added recently. Using pipe
instead improves compatibility with NetBSD 5.
R=jsing
CC=golang-dev
https://golang.org/cl/
6268045
Brad Fitzpatrick [Mon, 4 Jun 2012 15:04:40 +0000 (08:04 -0700)]
net/http: add new Server benchmark
The new BenchmarkServer avoids profiling the client code
by running it in a child process.
R=rsc
CC=golang-dev
https://golang.org/cl/
6260053
Andrew Gerrand [Mon, 4 Jun 2012 14:55:45 +0000 (00:55 +1000)]
doc: mention 'hg update default' in contribution guidelines
Fixes #3634.
R=golang-dev, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/
6270047
Russ Cox [Mon, 4 Jun 2012 14:41:30 +0000 (10:41 -0400)]
doc/install: we don't print 'The compiler is 6g' anymore
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6273050
Ryan Barrett [Mon, 4 Jun 2012 14:36:24 +0000 (10:36 -0400)]
misc/emacs: make compilation-mode's next-error understand test failure output.
specifically, adds a go-test element to compilation-error-regexp-alist[-alist].
Fixes #3629.
R=golang-dev, rsc, sameer
CC=golang-dev, jba
https://golang.org/cl/
6197091
Brad Fitzpatrick [Mon, 4 Jun 2012 14:18:06 +0000 (07:18 -0700)]
net/textproto: add benchmark, cleanup, update comment
The cleanup also makes it ~5% faster, but that's
not the point of this CL.
Optimizations can come in future CLs.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6286043
Brad Fitzpatrick [Mon, 4 Jun 2012 14:06:05 +0000 (07:06 -0700)]
net/http: simplify ParseHTTPVersion
Removes code. No need for atoi helper.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/
6285045
Nigel Tao [Mon, 4 Jun 2012 10:53:32 +0000 (20:53 +1000)]
cmd/gc: recognize u<<1 op u>>31 as a rotate when op is ^, not just |.
R=rsc
CC=golang-dev
https://golang.org/cl/
6249071
Shenghou Ma [Mon, 4 Jun 2012 07:21:58 +0000 (15:21 +0800)]
api: add Linux/ARM to go1 API
It's very unfortunate that the type of Data field of struct
RawSockaddr is [14]uint8 on Linux/ARM instead of [14]int8
on all the others.
btw, it should be [14]int8 according to my header files.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6275050
Brad Fitzpatrick [Mon, 4 Jun 2012 05:40:16 +0000 (22:40 -0700)]
net/http: change a Del to delete
No need to fix case of "Host" string literal.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/
6278049
Mikio Hara [Mon, 4 Jun 2012 00:57:03 +0000 (09:57 +0900)]
path/filepath: fix test
Make it possible to run test over symlinked GOROOT.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/
6268046
Russ Cox [Sun, 3 Jun 2012 15:08:17 +0000 (11:08 -0400)]
time: make Format 2.7x faster
benchmark old ns/op new ns/op delta
BenchmarkFormat 2495 937 -62.44%
BenchmarkFormatNow 2308 889 -61.48%
Update #3679.
R=r
CC=golang-dev
https://golang.org/cl/
6278047
Joel Sing [Sun, 3 Jun 2012 13:54:14 +0000 (23:54 +1000)]
net: move cgo address info flags to per-platform files
Move address info flags to per-platform files. This is needed to
enable cgo on NetBSD (and later OpenBSD), as some of the currently
used AI_* defines do not exist on these platforms.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6250075
Alex Brainman [Sun, 3 Jun 2012 09:27:17 +0000 (19:27 +1000)]
syscall: correct Win32finddata definition
Fixes #3685.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6261053
Russ Cox [Sun, 3 Jun 2012 03:57:38 +0000 (23:57 -0400)]
cmd/5g: fix typo
TBR=lvd
CC=golang-dev
https://golang.org/cl/
6275048
Russ Cox [Sun, 3 Jun 2012 03:02:39 +0000 (23:02 -0400)]
api: add net.UnixConn's CloseRead and CloseWrite methods
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6278045
Luuk van Dijk [Sun, 3 Jun 2012 02:50:57 +0000 (22:50 -0400)]
cmd/gc: inline slice[arr,str] in the frontend (mostly).
R=rsc, ality, rogpeppe, minux.ma, dave
CC=golang-dev
https://golang.org/cl/
5966075
Russ Cox [Sun, 3 Jun 2012 02:43:11 +0000 (22:43 -0400)]
exp/html/atom: faster Lookup with smaller tables
Use perfect cuckoo hash, to avoid binary search.
Define Atom bits as offset+len in long string instead
of enumeration, to avoid string headers.
Before: 1909 string bytes + 6060 tables = 7969 total data
After: 1406 string bytes + 2048 tables = 3454 total data
benchmark old ns/op new ns/op delta
BenchmarkLookup 83878 64681 -22.89%
R=nigeltao, r
CC=golang-dev
https://golang.org/cl/
6262051
Shenghou Ma [Sat, 2 Jun 2012 22:49:57 +0000 (06:49 +0800)]
syscall: fix 32-bit uid calls
16-bit uid calls are not always supported in newer kernels.
R=dave, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/
6279047
Shenghou Ma [Sat, 2 Jun 2012 20:03:09 +0000 (04:03 +0800)]
runtime: remove unnecessary macros in vlop_arm.s
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6270045
Shenghou Ma [Sat, 2 Jun 2012 19:08:49 +0000 (03:08 +0800)]
cmd/5a, cmd/5l, math: add CLZ instruction for ARM
Supported in ARMv5 and above.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6284043
Jan Ziak [Sat, 2 Jun 2012 18:02:44 +0000 (14:02 -0400)]
runtime: add (unused for now) gc field to type information
R=rsc
CC=golang-dev
https://golang.org/cl/
6255074
Charles L. Dorian [Sat, 2 Jun 2012 17:06:12 +0000 (13:06 -0400)]
math: amd64 versions of Ceil, Floor and Trunc
Ceil to 4.81 from 20.6 ns/op
Floor to 4.37 from 13.5 ns/op
Trunc to 3.97 from 14.3 ns/op
Also changed three MOVSDs to MOVAPDs in log_amd64.s
R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/
6262048
Jan Mercl [Sat, 2 Jun 2012 17:00:09 +0000 (13:00 -0400)]
path/filepath: implement documented SkipDir behavior
Currently walk() doesn't check for err == SkipDir when iterating
a directory list, but such promise is made in the docs for WalkFunc.
Fixes #3486.
R=rsc, r
CC=golang-dev
https://golang.org/cl/
6257059
Shenghou Ma [Sat, 2 Jun 2012 16:54:28 +0000 (12:54 -0400)]
cmd/5c, cmd/5g, cmd/5l: enable use of R12, F8-F15
R=dave, rsc
CC=golang-dev
https://golang.org/cl/
6248070
Brad Fitzpatrick [Sat, 2 Jun 2012 01:42:36 +0000 (18:42 -0700)]
api: add FreeBSD to go1 API
Now that gri has made go/parser 15% faster, I offer this
change to slow back down cmd/api ~proportionately, adding
FreeBSD to the go1-checked set of platforms.
Really we should have done this earlier. This will prevent us
from breaking FreeBSD compatibility accidentally in the
future.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/
6279044
Rob Pike [Sat, 2 Jun 2012 01:34:14 +0000 (18:34 -0700)]
text/template/parse: restore the goroutine
To avoid goroutines during init, the nextItem function was a
clever workaround. Now that init goroutines are permitted,
restore the original, simpler design.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6282043
Robert Griesemer [Fri, 1 Jun 2012 23:27:49 +0000 (16:27 -0700)]
go/parser: ~15% faster parsing
- only compute current line position if needed
(i.e., if a comment is present)
- added benchmark
benchmark old ns/op new ns/op delta
BenchmarkParse
10902990 9313330 -14.58%
benchmark old MB/s new MB/s speedup
BenchmarkParse 5.31 6.22 1.17x
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/
6270043
Ryan Barrett [Fri, 1 Jun 2012 20:55:03 +0000 (16:55 -0400)]
misc/emacs: stop go-mode from spuriously marking the buffer modified when it loads
R=golang-dev, sameer, bradfitz
CC=golang-dev, jba
https://golang.org/cl/
6213056
Russ Cox [Fri, 1 Jun 2012 14:23:15 +0000 (10:23 -0400)]
cmd/6l: loop alignment, disabled
Saving the code in case we improve things enough that
it matters later, but at least right now it is not worth doing.
R=ken2
CC=golang-dev
https://golang.org/cl/
6248071
Russ Cox [Fri, 1 Jun 2012 14:10:59 +0000 (10:10 -0400)]
cmd/5g, cmd/6g, cmd/8g: delete clearstk
Dreg from https://golang.org/cl/
4629042
R=ken2
CC=golang-dev
https://golang.org/cl/
6259057
David Symonds [Fri, 1 Jun 2012 00:55:55 +0000 (10:55 +1000)]
misc/dashboard/codereview: handle abandoned CLs.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/
6257082
Nigel Tao [Thu, 31 May 2012 23:36:05 +0000 (09:36 +1000)]
exp/html/atom: faster, hash-based lookup.
exp/html/atom benchmark:
benchmark old ns/op new ns/op delta
BenchmarkLookup 199226 80770 -59.46%
exp/html benchmark:
benchmark old ns/op new ns/op delta
BenchmarkParser
4864890 4510834 -7.28%
BenchmarkHighLevelTokenizer
2209192 1969684 -10.84%
benchmark old MB/s new MB/s speedup
BenchmarkParser 16.07 17.33 1.08x
BenchmarkHighLevelTokenizer 35.38 39.68 1.12x
R=r
CC=golang-dev
https://golang.org/cl/
6261054
Rémy Oudompheng [Thu, 31 May 2012 21:30:55 +0000 (23:30 +0200)]
runtime: lower memory overhead of heap profiling.
The previous code was preparing arrays of entries that would be
filled if there was one entry every 128 bytes. Moving to a 4096
byte interval reduces the overhead per megabyte of address space
to 2kB from 64kB (on 64-bit systems).
The performance impact will be negative for very small MemProfileRate.
test/bench/garbage/tree2 -heapsize
800000000 (default memprofilerate)
Before: mprof
65993056 bytes (1664 bucketmem +
65991392 addrmem)
After: mprof
1989984 bytes (1680 bucketmem +
1988304 addrmem)
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/
6257069
Sameer Ajmani [Thu, 31 May 2012 20:51:49 +0000 (16:51 -0400)]
CONTRIBUTORS: Add Ryan Barrett (Google CLA)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/
6244071
Rémy Oudompheng [Thu, 31 May 2012 05:57:49 +0000 (07:57 +0200)]
runtime/pprof, misc/pprof: correct profile of total allocations.
The previous heap profile format did not include buckets with
zero used bytes. Also add several missing MemStats fields in
debug mode.
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/
6249068
Nigel Tao [Thu, 31 May 2012 05:37:18 +0000 (15:37 +1000)]
exp/html/atom: new package.
50% fewer mallocs in HTML tokenization, resulting in 25% fewer mallocs
in parsing go1.html.
Making the parser use integer comparisons instead of string comparisons
will be a follow-up CL, to be co-ordinated with Andy Balholm's work.
exp/html benchmarks before/after:
BenchmarkParser 500
4754294 ns/op 16.44 MB/s
parse_test.go:409: 500 iterations, 14651 mallocs per iteration
BenchmarkRawLevelTokenizer 2000 903481 ns/op 86.51 MB/s
token_test.go:678: 2000 iterations, 28 mallocs per iteration
BenchmarkLowLevelTokenizer 2000
1260485 ns/op 62.01 MB/s
token_test.go:678: 2000 iterations, 41 mallocs per iteration
BenchmarkHighLevelTokenizer 1000
2165964 ns/op 36.09 MB/s
token_test.go:678: 1000 iterations, 6616 mallocs per iteration
BenchmarkParser 500
4664912 ns/op 16.76 MB/s
parse_test.go:409: 500 iterations, 11266 mallocs per iteration
BenchmarkRawLevelTokenizer 2000 903065 ns/op 86.55 MB/s
token_test.go:678: 2000 iterations, 28 mallocs per iteration
BenchmarkLowLevelTokenizer 2000
1260032 ns/op 62.03 MB/s
token_test.go:678: 2000 iterations, 41 mallocs per iteration
BenchmarkHighLevelTokenizer 1000
2143356 ns/op 36.47 MB/s
token_test.go:678: 1000 iterations, 3231 mallocs per iteration
R=r, rsc, rogpeppe
CC=andybalholm, golang-dev
https://golang.org/cl/
6255062
Rob Pike [Thu, 31 May 2012 04:57:50 +0000 (21:57 -0700)]
regexp: fix a couple of bugs in the documentation
Byte slices are not strings.
Fixes #3687.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/
6257074
Andrew Gerrand [Thu, 31 May 2012 04:09:50 +0000 (14:09 +1000)]
misc/dashboard/app: add debug logging to notifyOnFailure; remove unused Result.OK function
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/
6258064
Andrew Gerrand [Thu, 31 May 2012 04:09:24 +0000 (14:09 +1000)]
misc/dashboard/app: fix tests
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/
6244069
Dave Cheney [Wed, 30 May 2012 23:10:03 +0000 (09:10 +1000)]
cmd/go: add -ccflags
Add -ccflags to pass arguments to {5,6,8}c
similar to -gcflags for {5,6,8}g.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6260047
Russ Cox [Wed, 30 May 2012 22:07:39 +0000 (18:07 -0400)]
cmd/gc: contiguous loop layout
Drop expecttaken function in favor of extra argument
to gbranch and bgen. Mark loop condition as likely to
be true, so that loops are generated inline.
The main benefit here is contiguous code when trying
to read the generated assembly. It has only minor effects
on the timing, and they mostly cancel the minor effects
that aligning function entry points had. One exception:
both changes made Fannkuch faster.
Compared to before CL
6244066 (before aligned functions)
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17
4222117400 4201958800 -0.48%
BenchmarkFannkuch11
3462631800 3215908600 -7.13%
BenchmarkGobDecode
20887622 20899164 +0.06%
BenchmarkGobEncode
9548772 9439083 -1.15%
BenchmarkGzip 151687 152060 +0.25%
BenchmarkGunzip 8742 8711 -0.35%
BenchmarkJSONEncode
62730560 62686700 -0.07%
BenchmarkJSONDecode
252569180 252368960 -0.08%
BenchmarkMandelbrot200
5267599 5252531 -0.29%
BenchmarkRevcomp25M
980813500 985248400 +0.45%
BenchmarkTemplate
361259100 357414680 -1.06%
Compared to tip (aligned functions):
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17
4140739800 4201958800 +1.48%
BenchmarkFannkuch11
3259914400 3215908600 -1.35%
BenchmarkGobDecode
20620222 20899164 +1.35%
BenchmarkGobEncode
9384886 9439083 +0.58%
BenchmarkGzip 150333 152060 +1.15%
BenchmarkGunzip 8741 8711 -0.34%
BenchmarkJSONEncode
65210990 62686700 -3.87%
BenchmarkJSONDecode
249394860 252368960 +1.19%
BenchmarkMandelbrot200
5273394 5252531 -0.40%
BenchmarkRevcomp25M
996013800 985248400 -1.08%
BenchmarkTemplate
360620840 357414680 -0.89%
R=ken2
CC=golang-dev
https://golang.org/cl/
6245069
Mikio Hara [Wed, 30 May 2012 21:12:24 +0000 (06:12 +0900)]
net: fix test to avoid unintentional nil pointer dereference
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/
6248065
Russ Cox [Wed, 30 May 2012 21:01:25 +0000 (17:01 -0400)]
cmd/5l: fix PLD
Was missing break.
R=ken2
CC=golang-dev
https://golang.org/cl/
6250078
Russ Cox [Wed, 30 May 2012 20:47:56 +0000 (16:47 -0400)]
cmd/6l, cmd/8l, cmd/5l: add AUNDEF instruction
On 6l and 8l, this is a real instruction, guaranteed to
cause an 'undefined instruction' exception.
On 5l, we simulate it as BL to address 0.
The plan is to use it as a signal to the linker that this
point in the instruction stream cannot be reached
(hence the changes to nofollow). This will help the
compiler explain that panicindex and friends do not
return without having to put a list of these functions
in the linker.
R=ken2
CC=golang-dev
https://golang.org/cl/
6255064
Russ Cox [Wed, 30 May 2012 20:26:38 +0000 (16:26 -0400)]
cmd/ld: align function entry on arch-specific boundary
16 seems pretty standard on x86 for function entry.
I don't know if ARM would benefit, so I used just 4
(single instruction alignment).
This has a minor absolute effect on the current timings.
The main hope is that it will make them more consistent from
run to run.
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17
4222117400 4140739800 -1.93%
BenchmarkFannkuch11
3462631800 3259914400 -5.85%
BenchmarkGobDecode
20887622 20620222 -1.28%
BenchmarkGobEncode
9548772 9384886 -1.72%
BenchmarkGzip 151687 150333 -0.89%
BenchmarkGunzip 8742 8741 -0.01%
BenchmarkJSONEncode
62730560 65210990 +3.95%
BenchmarkJSONDecode
252569180 249394860 -1.26%
BenchmarkMandelbrot200
5267599 5273394 +0.11%
BenchmarkRevcomp25M
980813500 996013800 +1.55%
BenchmarkTemplate
361259100 360620840 -0.18%
R=ken2
CC=golang-dev
https://golang.org/cl/
6244066
Russ Cox [Wed, 30 May 2012 20:10:53 +0000 (16:10 -0400)]
cmd/6l, cmd/8l: fix chaining bug in jump rewrite
The code was inconsistent about when it used
brchain(x) and when it used x directly, with the result
that you could end up emitting code for brchain(x) but
leave the jump pointing at an unemitted x.
R=ken2
CC=golang-dev
https://golang.org/cl/
6250077
Ivan Krasin [Wed, 30 May 2012 20:08:38 +0000 (16:08 -0400)]
compress/flate: fix overflow on 2GB input. Reset hashOffset every 16 MB.
This bug has been introduced in the following revision:
changeset: 11404:
26dceba5c610
user: Ivan Krasin <krasin@golang.org>
date: Mon Jan 23 09:19:39 2012 -0500
summary: compress/flate: reduce memory pressure at cost of additional arithmetic operation.
This is the review page for that CL: https://golang.org/cl/
5555070 /
R=rsc, imkrasin
CC=golang-dev
https://golang.org/cl/
6249067
Mats Lidell [Wed, 30 May 2012 20:04:29 +0000 (16:04 -0400)]
go-mode: Works for both GNU-Emacs and XEmacs-21.5
Fixes some portability issues between the Emacsen.
R=golang-dev, sameer, bradfitz, ryanb
CC=golang-dev
https://golang.org/cl/
6206043
Rob Pike [Wed, 30 May 2012 19:31:28 +0000 (12:31 -0700)]
test/bench/shootout: more speedups
Most significant in mandelbrot, from avoiding MOVSD between registers,
but there are others.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6258063
Russ Cox [Wed, 30 May 2012 18:41:19 +0000 (14:41 -0400)]
cmd/6g: avoid MOVSD between registers
MOVSD only copies the low half of the packed register pair,
while MOVAPD copies both halves. I assume the internal
register renaming works better with the latter, since it makes
our code run 25% faster.
Before:
mandelbrot 16000
gcc -O2 mandelbrot.c 28.44u 0.00s 28.45r
gc mandelbrot 44.12u 0.00s 44.13r
gc_B mandelbrot 44.17u 0.01s 44.19r
After:
mandelbrot 16000
gcc -O2 mandelbrot.c 28.22u 0.00s 28.23r
gc mandelbrot 32.81u 0.00s 32.82r
gc_B mandelbrot 32.82u 0.00s 32.83r
R=ken2
CC=golang-dev
https://golang.org/cl/
6248068
Russ Cox [Wed, 30 May 2012 18:40:59 +0000 (14:40 -0400)]
shootout: make mandelbrot.go more like mandelbrot.c
Surprise! The C code is using floating point values for its counters.
Its off the critical path, but the Go code and C code are supposed to
be as similar as possible to make comparisons meaningful.
It doesn't have a significant effect.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/
6260058
Sameer Ajmani [Wed, 30 May 2012 18:38:40 +0000 (14:38 -0400)]
A+C: add Mats Lidell. He signed the agreement with the Sweden email
address, but his changelist is under the Gmail address.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6248069
Jean-Marc Eurin [Wed, 30 May 2012 18:18:58 +0000 (14:18 -0400)]
misc/emacs: Use patch output of gofmt instead of replacing the buffer.
This uses the patch output of gofmt (-d option) and applies each
chunk to the buffer, instead of replacing the whole buffer. The
main advantage is that the undo history is kept across gofmt'ings,
so it can really be used as a before-save-hook.
R=sameer, sameer
CC=golang-dev
https://golang.org/cl/
6198047
Rob Pike [Wed, 30 May 2012 17:35:47 +0000 (10:35 -0700)]
test/bench/shootout/timing.log: mandelbrot is restored
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/
6259054
Joel Sing [Wed, 30 May 2012 17:27:04 +0000 (03:27 +1000)]
runtime: always initialise procid on netbsd
The correct procid is needed for unparking LWPs on NetBSD - always
initialise procid in minit() so that cgo works correctly. The non-cgo
case already works correctly since procid is initialised via
lwp_create().
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6257071
Jan Ziak [Wed, 30 May 2012 17:07:52 +0000 (13:07 -0400)]
runtime: update field types in preparation for GC changes
R=rsc, remyoudompheng, minux.ma, ality
CC=golang-dev
https://golang.org/cl/
6242061
Joel Sing [Wed, 30 May 2012 17:06:38 +0000 (03:06 +1000)]
cmd/ld: increase number of ELF sections
On NetBSD a cgo enabled binary has more than 32 sections - bump NSECTS
so that we can actually link them successfully.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6261052
Jan Ziak [Wed, 30 May 2012 17:04:48 +0000 (13:04 -0400)]
runtime: hide symbol table from garbage collector
R=rsc
CC=golang-dev
https://golang.org/cl/
6243059
Marcel van Lohuizen [Wed, 30 May 2012 15:47:56 +0000 (17:47 +0200)]
exp/locale/collate: avoid double building in maketables.go. Also added check.
R=r
CC=golang-dev
https://golang.org/cl/
6202063
Russ Cox [Wed, 30 May 2012 14:26:59 +0000 (10:26 -0400)]
test/bench/go1: add mandelbrot for floating point
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6244063
Russ Cox [Wed, 30 May 2012 14:22:33 +0000 (10:22 -0400)]
cmd/6g: change sbop swap logic
I added the nl->op == OLITERAL case during the recent
performance round, and while it helps for small integer constants,
it hurts for floating point constants. In the Mandelbrot benchmark
it causes 2*Zr*Zi to compile like Zr*2*Zi:
0x000000000042663d <+249>: movsd %xmm6,%xmm0
0x0000000000426641 <+253>: movsd $2,%xmm1
0x000000000042664a <+262>: mulsd %xmm1,%xmm0
0x000000000042664e <+266>: mulsd %xmm5,%xmm0
instead of:
0x0000000000426835 <+276>: movsd $2,%xmm0
0x000000000042683e <+285>: mulsd %xmm6,%xmm0
0x0000000000426842 <+289>: mulsd %xmm5,%xmm0
It is unclear why that has such a dramatic performance effect
in a tight loop, but it's obviously slightly better code, so go with it.
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17
5957470000 5973924000 +0.28%
BenchmarkFannkuch11
3811295000 3869128000 +1.52%
BenchmarkGobDecode
26001900 25670500 -1.27%
BenchmarkGobEncode
12051430 11948590 -0.85%
BenchmarkGzip 177432 174821 -1.47%
BenchmarkGunzip 10967 10756 -1.92%
BenchmarkJSONEncode
78924750 79746900 +1.04%
BenchmarkJSONDecode
313606400 307081600 -2.08%
BenchmarkMandelbrot200
13670860 8200725 -40.01% !!!
BenchmarkRevcomp25M
1179194000 1206539000 +2.32%
BenchmarkTemplate
447931200 443948200 -0.89%
BenchmarkMD5Hash1K 2856 2873 +0.60%
BenchmarkMD5Hash8K 22083 22029 -0.24%
benchmark old MB/s new MB/s speedup
BenchmarkGobDecode 29.52 29.90 1.01x
BenchmarkGobEncode 63.69 64.24 1.01x
BenchmarkJSONEncode 24.59 24.33 0.99x
BenchmarkJSONDecode 6.19 6.32 1.02x
BenchmarkRevcomp25M 215.54 210.66 0.98x
BenchmarkTemplate 4.33 4.37 1.01x
BenchmarkMD5Hash1K 358.54 356.31 0.99x
BenchmarkMD5Hash8K 370.95 371.86 1.00x
R=ken2
CC=golang-dev
https://golang.org/cl/
6261051
Nigel Tao [Wed, 30 May 2012 11:38:46 +0000 (21:38 +1000)]
image/png: optimize paeth some more.
filterPaeth takes []byte arguments instead of byte arguments,
which avoids some redudant computation of the previous pixel
in the inner loop.
Also eliminate a bounds check in decoding the up filter.
benchmark old ns/op new ns/op delta
BenchmarkDecodeGray
3139636 2812531 -10.42%
BenchmarkDecodeNRGBAGradient
12341520 10971680 -11.10%
BenchmarkDecodeNRGBAOpaque
10740780 9612455 -10.51%
BenchmarkDecodePaletted
1819535 1818913 -0.03%
BenchmarkDecodeRGB
8974695 8178070 -8.88%
R=rsc
CC=golang-dev
https://golang.org/cl/
6243061
Alex Brainman [Wed, 30 May 2012 06:41:15 +0000 (16:41 +1000)]
runtime: disable new TestCrashHandle on freebsd to fix build
R=golang-dev
CC=golang-dev
https://golang.org/cl/
6256069
Rémy Oudompheng [Wed, 30 May 2012 06:04:11 +0000 (08:04 +0200)]
runtime: do not unset the special bit after finalization.
A block with finalizer might also be profiled. The special bit
is needed to unregister the block from the profile. It will be
unset only when the block is freed.
Fixes #3668.
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/
6249066
Andrew Balholm [Wed, 30 May 2012 05:50:12 +0000 (15:50 +1000)]
exp/html: Convert \r and \r\n to \n when tokenizing
Also escape "\r" as " " when rendering HTML.
Pass 2 additional tests.
R=nigeltao
CC=golang-dev
https://golang.org/cl/
6260046
Alex Brainman [Wed, 30 May 2012 05:10:54 +0000 (15:10 +1000)]
runtime: handle windows exceptions, even in cgo programs
Fixes #3543.
R=golang-dev, kardianos, rsc
CC=golang-dev, hectorchu, vcc.163
https://golang.org/cl/
6245063
Nigel Tao [Wed, 30 May 2012 03:00:32 +0000 (13:00 +1000)]
exp/html: add some tokenizer and parser benchmarks.
$GOROOT/src/pkg/exp/html/testdata/go1.html is an execution of the
$GOROOT/doc/go1.html template by godoc.
Sample numbers on my linux,amd64 desktop:
BenchmarkParser 500
4699198 ns/op 16.63 MB/s
--- BENCH: BenchmarkParser
parse_test.go:409: 1 iterations, 14653 mallocs per iteration
parse_test.go:409: 100 iterations, 14651 mallocs per iteration
parse_test.go:409: 500 iterations, 14651 mallocs per iteration
BenchmarkRawLevelTokenizer 2000 904957 ns/op 86.37 MB/s
--- BENCH: BenchmarkRawLevelTokenizer
token_test.go:657: 1 iterations, 28 mallocs per iteration
token_test.go:657: 100 iterations, 28 mallocs per iteration
token_test.go:657: 2000 iterations, 28 mallocs per iteration
BenchmarkLowLevelTokenizer 2000
1134300 ns/op 68.91 MB/s
--- BENCH: BenchmarkLowLevelTokenizer
token_test.go:657: 1 iterations, 41 mallocs per iteration
token_test.go:657: 100 iterations, 41 mallocs per iteration
token_test.go:657: 2000 iterations, 41 mallocs per iteration
BenchmarkHighLevelTokenizer 1000
2096179 ns/op 37.29 MB/s
--- BENCH: BenchmarkHighLevelTokenizer
token_test.go:657: 1 iterations, 6616 mallocs per iteration
token_test.go:657: 100 iterations, 6616 mallocs per iteration
token_test.go:657: 1000 iterations, 6616 mallocs per iteration
R=rsc
CC=andybalholm, golang-dev, r
https://golang.org/cl/
6257067
Brad Fitzpatrick [Tue, 29 May 2012 22:46:07 +0000 (15:46 -0700)]
net: skip UnixShutdown test on windows
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/
6259052
Rémy Oudompheng [Tue, 29 May 2012 22:08:58 +0000 (00:08 +0200)]
net: add CloseRead, CloseWrite methods to UnixConn.
Fixes #3345.
R=golang-dev, r, rsc, dave
CC=golang-dev, remy
https://golang.org/cl/
6214061
Rob Pike [Tue, 29 May 2012 22:08:08 +0000 (15:08 -0700)]
fmt: speed up 10-20%
The check for Stringer etc. can only fire if the test is not a builtin, so avoid
the expensive check if we know there's no chance.
Also put in a fast path for pad, which saves a more modest amount.
benchmark old ns/op new ns/op delta
BenchmarkSprintfEmpty 148 152 +2.70%
BenchmarkSprintfString 585 497 -15.04%
BenchmarkSprintfInt 441 396 -10.20%
BenchmarkSprintfIntInt 718 603 -16.02%
BenchmarkSprintfPrefixedInt 676 621 -8.14%
BenchmarkSprintfFloat 1003 953 -4.99%
BenchmarkManyArgs 2945 2312 -21.49%
BenchmarkScanInts
1704152 1734441 +1.78%
BenchmarkScanRecursiveInt
1837397 1828920 -0.46%
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6245068
Russ Cox [Tue, 29 May 2012 22:02:40 +0000 (18:02 -0400)]
encoding/json: add round trip test in Unmarshal
Also convert table to use tagged literal.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6258061
Brad Fitzpatrick [Tue, 29 May 2012 21:27:07 +0000 (14:27 -0700)]
net/http: better comment in hasToken
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6249065
Peter Kleiweg [Tue, 29 May 2012 20:30:06 +0000 (16:30 -0400)]
Emacs go-mode: don't indent the inside of strings.
Two fixes for indentation problems:
1. Properly recognize multi-line strings. These start with `, not ".
2. Don't indent a line if the beginning of the line is the end of a multi-line string. This happened for instance when inserting a closing bracket after a multi-line string.
R=sameer
CC=golang-dev
https://golang.org/cl/
6157044
Robert Griesemer [Tue, 29 May 2012 20:15:13 +0000 (13:15 -0700)]
exp/types: properly read dotted identifiers
Fixes #3682.
R=rsc
CC=golang-dev
https://golang.org/cl/
6256067
Brad Fitzpatrick [Tue, 29 May 2012 19:40:13 +0000 (12:40 -0700)]
net/http: flush server response gracefully when ignoring request body
This prevents clients from seeing RSTs and missing the response
body.
TCP stacks vary. The included test failed on Darwin before but
passed on Linux.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6256066
Russ Cox [Tue, 29 May 2012 18:37:41 +0000 (14:37 -0400)]
merge unexpected branch
Dmitriy Vyukov [Tue, 29 May 2012 18:30:56 +0000 (22:30 +0400)]
time: fix deadlock in Sleep(0)
See time/sleep_test.go for repro.
R=golang-dev, r, rsc
CC=golang-dev, patrick.allen.higgins
https://golang.org/cl/
6250072
Brad Fitzpatrick [Tue, 29 May 2012 18:09:09 +0000 (11:09 -0700)]
database/sql: use driver.ColumnConverter everywhere consistently
It was only being used for (*Stmt).Exec, not Query, and not for
the same two methods on *DB.
This unifies (*Stmt).Exec's old inline code into the old
subsetArgs function, renaming it in the process (changing the
old word "subset" to "driver", mostly converted earlier)
Fixes #3640
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6258045
Russ Cox [Tue, 29 May 2012 18:02:29 +0000 (14:02 -0400)]
runtime: replace runtime·rnd function with ROUND macro
It's sad to introduce a new macro, but rnd shows up consistently
in profiles, and the function call overwhelms the two arithmetic
instructions it performs.
R=r
CC=golang-dev
https://golang.org/cl/
6260051
Rob Pike [Tue, 29 May 2012 18:01:50 +0000 (11:01 -0700)]
test/bench/shootout/timing.log: update after recent compiler changes
Moving panic out of line speeds up fannkuch almost a factor of two.
Changes to bitwhacking code affect mandelbrot badly.
R=golang-dev, bradfitz, rsc, r
CC=golang-dev
https://golang.org/cl/
6258056
Russ Cox [Tue, 29 May 2012 17:33:37 +0000 (13:33 -0400)]
exp/types: disable test
It's broken and seems to be exp/types's fault.
Update #3682.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/
6243068
Joel Sing [Tue, 29 May 2012 16:52:50 +0000 (02:52 +1000)]
runtime: make go work on netbsd/386
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6254055
Mikio Hara [Tue, 29 May 2012 16:52:50 +0000 (01:52 +0900)]
net: fix comment on FileListener
R=rsc
CC=golang-dev
https://golang.org/cl/
6242067
Russ Cox [Tue, 29 May 2012 16:45:40 +0000 (12:45 -0400)]
crypto: housekeeping
Rename _Block to block, don't bother making it compute count.
Add benchmarks.
R=agl, agl
CC=golang-dev
https://golang.org/cl/
6243053
Mikio Hara [Tue, 29 May 2012 16:42:36 +0000 (01:42 +0900)]
undo CL
6248054 /
0f418a63cdf9
breaks public API document style
««« original CL description
net: fix comment on FileListener
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6248054
»»»
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/
6242066
Peter Kleiweg [Tue, 29 May 2012 16:40:12 +0000 (12:40 -0400)]
Emacs go-mode: fix Emacs freeze-up when copy/pasting from string or comment.
Fixes #3509.
Fixes #2767.
R=golang-dev, sameer
CC=golang-dev
https://golang.org/cl/
6139066
Akshat Kumar [Tue, 29 May 2012 16:32:42 +0000 (12:32 -0400)]
cmd/6l: Fixes for 64-bit Plan 9
Plan 9 versions for amd64 have 2 megabyte pages.
This also fixes the logic for 32-bit vs 64-bit Plan 9,
making 64-bit the default, and adds logic to generate
a symbols table.
R=golang-dev, rsc, rminnich, ality, 0intro
CC=golang-dev, john
https://golang.org/cl/
6218046
Russ Cox [Tue, 29 May 2012 16:09:27 +0000 (12:09 -0400)]
cmd/6g, cmd/8g: move panicindex calls out of line
The old code generated for a bounds check was
CMP
JLT ok
CALL panicindex
ok:
...
The new code is (once the linker finishes with it):
CMP
JGE panic
...
panic:
CALL panicindex
which moves the calls out of line, putting more useful
code in each cache line. This matters especially in tight
loops, such as in Fannkuch. The benefit is more modest
elsewhere, but real.
From test/bench/go1, amd64:
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17
6096092000 6088808000 -0.12%
BenchmarkFannkuch11
6151404000 4020463000 -34.64%
BenchmarkGobDecode
28990050 28894630 -0.33%
BenchmarkGobEncode
12406310 12136730 -2.17%
BenchmarkGzip 179923 179903 -0.01%
BenchmarkGunzip 11219 11130 -0.79%
BenchmarkJSONEncode
86429350 86515900 +0.10%
BenchmarkJSONDecode
334593800 315728400 -5.64%
BenchmarkRevcomp25M
1219763000 1180767000 -3.20%
BenchmarkTemplate
492947600 483646800 -1.89%
And 386:
benchmark old ns/op new ns/op delta
BenchmarkBinaryTree17
6354902000 6243000000 -1.76%
BenchmarkFannkuch11
8043769000 7326965000 -8.91%
BenchmarkGobDecode
19010800 18941230 -0.37%
BenchmarkGobEncode
14077500 13792460 -2.02%
BenchmarkGzip 194087 193619 -0.24%
BenchmarkGunzip 12495 12457 -0.30%
BenchmarkJSONEncode
125636400 125451400 -0.15%
BenchmarkJSONDecode
696648600 685032800 -1.67%
BenchmarkRevcomp25M
2058088000 2052545000 -0.27%
BenchmarkTemplate
602140000 589876800 -2.04%
To implement this, two new instruction forms:
JLT target // same as always
JLT $0, target // branch expected not taken
JLT $1, target // branch expected taken
The linker could also emit the prediction prefixes, but it
does not: expected taken branches are reversed so that the
expected case is not taken (as in example above), and
the default expectaton for such a jump is not taken
already.
R=golang-dev, gri, r, dave
CC=golang-dev
https://golang.org/cl/
6248049
Sameer Ajmani [Tue, 29 May 2012 15:12:31 +0000 (11:12 -0400)]
A+C: Peter Kleiweg (individual CLA)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6260049
Andrew Balholm [Tue, 29 May 2012 03:39:54 +0000 (13:39 +1000)]
exp/html: implement Noah's Ark clause
Implement the (3-per-family) Noah's Ark clause (i.e. don't put
more than three identical elements on the list of active formatting
elements.
Also, when running tests, sort attributes by name before dumping
them.
Pass 4 additional tests with Noah's Ark clause (including one
that needs attributes to be sorted).
Pass 5 additional, unrelated tests because of sorting attributes.
R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/
6247056
Mikio Hara [Mon, 28 May 2012 21:13:56 +0000 (06:13 +0900)]
net: fix comment on FileListener
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6248054
Mikio Hara [Mon, 28 May 2012 21:12:06 +0000 (06:12 +0900)]
net: make parsePort as a function
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
6256059
Brad Fitzpatrick [Mon, 28 May 2012 18:26:45 +0000 (11:26 -0700)]
net/http: avoid fmt.Fprintf in Header.WriteSubset
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/
6242062
Brad Fitzpatrick [Mon, 28 May 2012 18:07:24 +0000 (11:07 -0700)]
net/http: avoid a bunch of unnecessary CanonicalHeaderKey calls
CanonicalHeaderKey didn't allocate, but it did use unnecessary
CPU in the hot path, deciding it didn't need to allocate.
I considered using constants for all these common header keys
but I didn't think it would be prettier. "Content-Length" looks
better than contentLength or hdrContentLength, etc.
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/
6255053
Brad Fitzpatrick [Mon, 28 May 2012 17:58:49 +0000 (10:58 -0700)]
net/http: speed up ServeMux when no patterns contain hostnames
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/
6248053
Brad Fitzpatrick [Mon, 28 May 2012 17:55:39 +0000 (10:55 -0700)]
net/http: correct and faster hasToken
Fixes #3535
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/
6245060
Alexey Borzenkov [Mon, 28 May 2012 17:46:51 +0000 (10:46 -0700)]
net/http: reuse http proxy connections for different http requests
Comment on cache keys above connectMethod says "http to proxy, http
anywhere after that", however in reality target address was always
included, which prevented http requests to different target
addresses to reuse the same http proxy connection.
R=golang-dev, r, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/
5901064
Alex Brainman [Sun, 27 May 2012 08:57:16 +0000 (18:57 +1000)]
syscall: simplify text returned by Errno.Error() when FormatMessage fails
Fixes #3623.
R=golang-dev, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/
6218072
Alexey Borzenkov [Sat, 26 May 2012 21:27:36 +0000 (14:27 -0700)]
net/rpc: improve response reading logic
CL
5956051 introduced too many call != nil checks, so
attempt to improve this by splitting logic into three
distinct parts.
R=r
CC=golang-dev
https://golang.org/cl/
6248048