Commit graph

13353 commits

Author SHA1 Message Date
Andrew Gerrand 71a1673c0a tag go1.0.2
R=golang-dev, rsc, dsymonds, minux.ma
CC=golang-dev
https://golang.org/cl/6305089
2012-06-14 13:18:10 +10:00
Andrew Gerrand 00e8a3ae91 doc: document go1.0.2
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6298079
2012-06-14 11:44:00 +10:00
Nigel Tao 8f84328fdc cmd/gc: inline convT2E when T is uintptr-shaped.
GOARCH=amd64 benchmarks

src/pkg/runtime
benchmark                  old ns/op    new ns/op    delta
BenchmarkConvT2ESmall             10           10   +1.00%
BenchmarkConvT2EUintptr            9            0  -92.07%
BenchmarkConvT2EBig               74           74   -0.27%
BenchmarkConvT2I                  27           26   -3.62%
BenchmarkConvI2E                   4            4   -7.05%
BenchmarkConvI2I                  20           19   -2.99%

test/bench/go1
benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    5930908000   5937260000   +0.11%
BenchmarkFannkuch11      3927057000   3933556000   +0.17%
BenchmarkGobDecode         21998090     21870620   -0.58%
BenchmarkGobEncode         12725310     12734480   +0.07%
BenchmarkGzip             567617600    567892800   +0.05%
BenchmarkGunzip           178284100    178706900   +0.24%
BenchmarkJSONEncode        87693550     86794300   -1.03%
BenchmarkJSONDecode       314212600    324115000   +3.15%
BenchmarkMandelbrot200      7016640      7073766   +0.81%
BenchmarkParse              7852100      7892085   +0.51%
BenchmarkRevcomp         1285663000   1286147000   +0.04%
BenchmarkTemplate         566823800    567606200   +0.14%

I'm not entirely sure why the JSON* numbers have changed, but
eyeballing the profile suggests that it could be spending less
and more time in runtime.{new,old}stack, so it could simply be
stack-split boundary noise.

R=rsc, dave, bsiegert, dsymonds
CC=golang-dev
https://golang.org/cl/6280049
2012-06-14 10:43:20 +10:00
Rob Pike 733ee91786 encoding/gob: don't cache broken encoding engines.
Fixes a situation where a nested bad type would still
permit the outer type to install a working engine, leading
to inconsistent behavior.

Fixes #3273.

R=bsiegert, rsc
CC=golang-dev
https://golang.org/cl/6294067
2012-06-13 15:55:43 -07:00
Brad Fitzpatrick 45969825b5 net/http: use index.html modtime (not directory) for If-Modified-Since
Thanks to Håvid Falch for finding the problem.

Fixes #3414

R=r, rsc
CC=golang-dev
https://golang.org/cl/6300081
2012-06-13 14:53:05 -07:00
Rémy Oudompheng 5468d16467 strconv: extend fast parsing algorithm to ParseFloat(s, 32)
benchmark                  old ns/op    new ns/op    delta
BenchmarkAtof32Decimal           215           73  -65.72%
BenchmarkAtof32Float             233           83  -64.21%
BenchmarkAtof32FloatExp         3351          209  -93.76%
BenchmarkAtof32Random           1939          260  -86.59%

R=rsc
CC=golang-dev, remy
https://golang.org/cl/6294071
2012-06-13 23:52:00 +02:00
Robert Griesemer 10b88888f6 math/big: correctly test for positive inputs in Int.GCD
Also: better GCD tests.

R=rsc
CC=golang-dev
https://golang.org/cl/6295076
2012-06-13 13:54:36 -07:00
Russ Cox 1c4e20744a syscall: fix windows copyFindData
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6301076
2012-06-13 16:44:19 -04:00
Robert Griesemer 8140cd9149 godoc: show comments in various filtered views
Fixes #3454.

R=rsc
CC=golang-dev
https://golang.org/cl/6305069
2012-06-13 13:32:59 -07:00
Robert Griesemer f5f23e075e go/ast: comment map implementation
A comment map associates comments with AST nodes
and permits correct updating of the AST's comment
list when the AST is manipulated.

R=rsc
CC=golang-dev
https://golang.org/cl/6281044
2012-06-13 13:32:29 -07:00
Russ Cox 503aa6505e go/build: fix boolean negation
!(linux&cgo | darwin&cgo)
= (!linux|!cgo) & (!darwin|!cgo)
= (!linux&!darwin) | !cgo  // new comment
≠ !linux | !darwin | !cgo  // old comment

Fixes #3726.

R=golang-dev, bsiegert
CC=golang-dev
https://golang.org/cl/6306076
2012-06-13 16:24:56 -04:00
Jan Ziak 51fe5444fa runtime: improved continuity in hash computation
Fixes #3695.

R=r, dave, rsc
CC=golang-dev
https://golang.org/cl/6304062
2012-06-13 15:52:32 -04:00
Robert Griesemer f4240666be math/big: fix binaryGCD
R=rsc
CC=golang-dev
https://golang.org/cl/6297085
2012-06-13 10:29:06 -07:00
Robert Griesemer b7c5e23df0 math/big: various cleanups
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6295072
2012-06-13 09:37:47 -07:00
Christopher Swenson 38735b957c math/big: Implemented binary GCD algorithm
benchmark                    old ns/op    new ns/op    delta
BenchmarkGCD10x10                 4383         2126  -51.49%
BenchmarkGCD10x100                5612         2124  -62.15%
BenchmarkGCD10x1000               8843         2622  -70.35%
BenchmarkGCD10x10000             17025         6576  -61.37%
BenchmarkGCD10x100000           118985        48130  -59.55%
BenchmarkGCD100x100              45328        11683  -74.23%
BenchmarkGCD100x1000             50141        12678  -74.72%
BenchmarkGCD100x10000           110314        26719  -75.78%
BenchmarkGCD100x100000          630000       156041  -75.23%
BenchmarkGCD1000x1000           654809       137973  -78.93%
BenchmarkGCD1000x10000          985683       159951  -83.77%
BenchmarkGCD1000x100000        4920792       366399  -92.55%
BenchmarkGCD10000x10000       16848950      3732062  -77.85%
BenchmarkGCD10000x100000      55401500      4675876  -91.56%
BenchmarkGCD100000x100000   1126775000    258951800  -77.02%

R=gri, rsc, bradfitz, remyoudompheng, mtj
CC=golang-dev
https://golang.org/cl/6305065
2012-06-13 09:31:20 -07:00
Jean-Marc Eurin 44a3a58e45 misc/emacs: Fix a failure when /tmp/<file>.go exists.
R=sameer
CC=golang-dev
https://golang.org/cl/6296060
2012-06-13 10:25:00 -04:00
Robert Griesemer bb3af7554a CONTRIBUTORS: added Christopher Swenson (Google CLA)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6302069
2012-06-12 18:11:19 -07:00
Andrew Gerrand 9115a8bca4 doc/install: mention GOPATH and point to code.html
Fixes #3469.

R=golang-dev, kevlar, rsc, r
CC=golang-dev
https://golang.org/cl/6304049
2012-06-13 10:33:02 +10:00
Nigel Tao 66429dcf75 exp/html: simplify some of the parser's internal methods.
benchmark          old ns/op    new ns/op    delta
BenchmarkParser      4006888      3950604   -1.40%

R=r, andybalholm
CC=golang-dev
https://golang.org/cl/6301070
2012-06-13 10:13:05 +10:00
Robert Griesemer 008c62b2cd math/big: optimize common case of Int.Bit(0)
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/6306069
2012-06-12 09:36:35 -07:00
Rob Pike ea3c3bb3a8 encoding/gob: better handling of nil pointers
- better message for top-level nil
- nil inside interface yields error, not panic

Fixes #3704.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6304064
2012-06-12 00:36:39 -04:00
Rob Pike 2a0fdf6ea0 fmt.Fscanf: don't read past newline
Makes interactive uses work line-by-line.
Fixes #3481.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/6297075
2012-06-11 17:52:09 -04:00
Robert Griesemer 49d6e49087 exp/types: testing resolution of qualified identifiers
Also: fix a bug with exp/types/GcImport.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6302060
2012-06-11 11:06:27 -07:00
Jean-Marc Eurin d608b15db7 misc/emacs: Fix the automatic gofmt when creating a new file.
Patching the buffer with the output from gofmt -d only works if
the file already exists. If it doesn't, replace the content with
the output of gofmt.

R=sameer
CC=golang-dev
https://golang.org/cl/6302063
2012-06-11 13:12:28 -04:00
Brad Fitzpatrick 1d609f9b9f encoding/gob: fix doc typo
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6300078
2012-06-09 18:30:44 -07:00
Dave Cheney 0b09425b5c runtime: use uintptr where possible in malloc stats
linux/arm OMAP4 pandaboard

benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17   68723297000  37026214000  -46.12%
BenchmarkFannkuch11     34962402000  35958435000   +2.85%
BenchmarkGobDecode        137298600    124182150   -9.55%
BenchmarkGobEncode         60717160     60006700   -1.17%
BenchmarkGzip            5647156000   5550873000   -1.70%
BenchmarkGunzip          1196350000   1198670000   +0.19%
BenchmarkJSONEncode       863012800    782898000   -9.28%
BenchmarkJSONDecode      3312989000   2781800000  -16.03%
BenchmarkMandelbrot200     45727540     45703120   -0.05%
BenchmarkParse             74781800     59990840  -19.78%
BenchmarkRevcomp          140043650    139462300   -0.42%
BenchmarkTemplate        6467682000   5832153000   -9.83%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkGobDecode             5.59         6.18    1.11x
BenchmarkGobEncode            12.64        12.79    1.01x
BenchmarkGzip                  3.44         3.50    1.02x
BenchmarkGunzip               16.22        16.19    1.00x
BenchmarkJSONEncode            2.25         2.48    1.10x
BenchmarkJSONDecode            0.59         0.70    1.19x
BenchmarkParse                 0.77         0.97    1.26x
BenchmarkRevcomp              18.15        18.23    1.00x
BenchmarkTemplate              0.30         0.33    1.10x

darwin/386 core duo

benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17   10591616577   9678245733   -8.62%
BenchmarkFannkuch11     10758473315  10749303846   -0.09%
BenchmarkGobDecode         34379785     34121250   -0.75%
BenchmarkGobEncode         23523721     23475750   -0.20%
BenchmarkGzip            2486191492   2446539568   -1.59%
BenchmarkGunzip           444179328    444250293   +0.02%
BenchmarkJSONEncode       221138507    219757826   -0.62%
BenchmarkJSONDecode      1056034428   1048975133   -0.67%
BenchmarkMandelbrot200     19862516     19868346   +0.03%
BenchmarkRevcomp         3742610872   3724821662   -0.48%
BenchmarkTemplate         960283112    944791517   -1.61%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkGobDecode            22.33        22.49    1.01x
BenchmarkGobEncode            32.63        32.69    1.00x
BenchmarkGzip                  7.80         7.93    1.02x
BenchmarkGunzip               43.69        43.68    1.00x
BenchmarkJSONEncode            8.77         8.83    1.01x
BenchmarkJSONDecode            1.84         1.85    1.01x
BenchmarkRevcomp              67.91        68.24    1.00x
BenchmarkTemplate              2.02         2.05    1.01x

R=rsc, 0xe2.0x9a.0x9b, mirtchovski
CC=golang-dev, minux.ma
https://golang.org/cl/6297047
2012-06-08 17:35:14 -04:00
Robert Griesemer 014d036d84 math/big: added nat.trailingZeroBits, simplified some code
Will simplify implementation of binaryGCD.

R=rsc, cswenson
CC=golang-dev
https://golang.org/cl/6299064
2012-06-08 13:00:49 -07:00
Russ Cox 7762a9dc1f syscall: unexport GetCurrentProcessId on Windows
This slipped in with the implementation of Getpid in CL 5909043.
I'd exclude that CL entirely but it is tangled up in the Win32finddata changes.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6297065
2012-06-08 14:28:29 -04:00
Russ Cox 56f5e6d845 syscall: fix windows build
TBR=bradfitz
CC=golang-dev
https://golang.org/cl/6303061
2012-06-08 14:04:44 -04:00
Russ Cox 7ad37673e1 syscall: revert API changes in Windows Win32finddata fix.
Preserve old API by using correct struct in system call
and then copying the results, as we did for SetsockoptLinger.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6307065
2012-06-08 13:54:48 -04:00
Russ Cox 0c2f0cca7c cmd/api: handle empty API file, ignore -next in release
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6298063
2012-06-08 13:44:13 -04:00
Russ Cox 50452720ba regexp/syntax: unexport ErrUnexpectedParen
This new error is the only API change in the current draft of
Go 1.0.2 CLs. I'd like to include the CL that introduced it,
because it replaces a mysterious 'internal error' with a
useful error message, but I don't want any API changes,
so unexport the error constant for now. It can be
re-exported for Go 1.1.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6294055
2012-06-08 13:05:01 -04:00
Nigel Tao 6c204982e0 exp/html: check the context node for consistency when parsing fragments.
R=rsc
CC=golang-dev
https://golang.org/cl/6303053
2012-06-08 13:55:15 +10:00
Dave Cheney 072e36d5ef cmd/5c, cmd/5g, cmd/5l: fix cross compilation failure on darwin
Fixes #3708.

The fix to allow 5{c,g,l} to compile under clang 3.1 broke cross
compilation on darwin using the Apple default compiler on 10.7.3.

This failure was introduced in 9b455eb64690.

This has been tested by cross compiling on darwin/amd64 to linux/arm using

* gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
* clang version 3.1 (branches/release_31)

As well as on linux/arm using

* gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
* Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0)
* Debian clang version 3.1-4 (branches/release_31) (based on LLVM 3.1)

R=consalus, rsc
CC=golang-dev
https://golang.org/cl/6307058
2012-06-08 13:13:02 +10:00
Shenghou Ma 97300640ca test/bench/shoutout: fix compliation
-lm must come after the source file, versions of gcc insist this strict order.
On standard compliant systems, we no longer need malloc.h for malloc.
Use pkg-config(1) to get correct glib cflags and libs.
Fix compiler warning in threadring.c and k-nucleotide.c.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6198076
2012-06-08 02:56:23 +08:00
Shenghou Ma a0084b3494 cmd/5a, cmd/5l: add MULW{T,B} and MULAW{T,B} support for ARM
Supported in ARMv5TE and above.
        Also corrected MULA disassembly listing.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6265045
2012-06-08 02:42:28 +08:00
Russ Cox f51390b23c cmd/cgo: make Go code order deterministic
The type declarations were being generated using
a range over a map, which meant that successive
runs produced different orders. This will make sure
successive runs produce the same files.

Fixes #3707.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6300062
2012-06-07 12:37:50 -04:00
Russ Cox b185de82a4 cmd/gc: limit data disassembly to -SS
This makes -S useful again.

R=ken2
CC=golang-dev
https://golang.org/cl/6302054
2012-06-07 12:05:34 -04:00
Russ Cox 2a9410c19c cmd/gc: fix LEAQ $0, SI bug
Cannot take effective address of constant.

Fixes #3670.

R=ken2
CC=golang-dev
https://golang.org/cl/6299055
2012-06-07 11:59:18 -04:00
Russ Cox 9fe424737b cmd/gc: run escape analysis in call graph dependency order
If there are mutually recursive functions, there is a cycle in
the dependency graph, so the order is actually dependency order
among the strongly connected components: mutually recursive
functions get put into the same batch and analyzed together.
(Until now the entire package was put in one batch.)

The non-recursive case (single function, maybe with some
closures inside) will be able to be more precise about inputs
that escape only back to outputs, but that is not implemented yet.

R=ken2
CC=golang-dev, lvd
https://golang.org/cl/6304050
2012-06-07 03:15:09 -04:00
Russ Cox 6363fc5aa6 cmd/gc: fix type checking loop
CL 4313064 fixed its test case but did not address a
general enough problem:

type T1 struct { F *T2 }
type T2 T1
type T3 T2

could still end up copying the definition of T1 for T2
before T1 was done being evaluated, or T3 before T2
was done.

In order to propagate the updates correctly,
record a copy of an incomplete type for re-execution
once the type is completed. Roll back CL 4313064.

Fixes #3709.

R=ken2
CC=golang-dev, lstoakes
https://golang.org/cl/6301059
2012-06-07 03:06:40 -04:00
Russ Cox f18ced3fc9 cmd/gc: delete dead code
R=ken2
CC=golang-dev
https://golang.org/cl/6307050
2012-06-07 02:15:23 -04:00
Russ Cox 744b23fe48 cmd/gc: do not crash on struct with _ field
Fixes #3607.

R=ken2
CC=golang-dev
https://golang.org/cl/6296052
2012-06-07 02:05:08 -04:00
Russ Cox ee5f59ab4f cmd/gc: preserve side effects during inlining of function with _ argument
Fixes #3593.

R=ken2
CC=golang-dev, lvd
https://golang.org/cl/6305061
2012-06-07 01:54:07 -04:00
Russ Cox 09b736a2ab encoding/json: fix panic unmarshaling into non-nil interface value
Fixes #3614.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6306051
2012-06-07 01:48:55 -04:00
Russ Cox 8022a1a588 cmd/gc: mark output of typename as type-checked
R=ken2
CC=golang-dev
https://golang.org/cl/6302051
2012-06-07 00:51:11 -04:00
Nigel Tao c8fac7b967 exp/html: when parsing, compare atoms (ints) instead of strings.
This is the mechanical part of the 2-part change that started with
https://golang.org/cl/6305053/

R=rsc
CC=andybalholm, golang-dev, r
https://golang.org/cl/6295055
2012-06-07 13:46:57 +10:00
Nigel Tao cd21eff705 exp/html: make the tokenizer return atoms for tag tokens.
This is part 1 of a 2 part changelist. Part 2 contains the mechanical
change to parse.go to compare atoms (ints) instead of strings.

The overall effect of the two changes are:
benchmark                      old ns/op    new ns/op    delta
BenchmarkParser                  4462274      4058254   -9.05%
BenchmarkRawLevelTokenizer        913202       912917   -0.03%
BenchmarkLowLevelTokenizer       1268626      1267836   -0.06%
BenchmarkHighLevelTokenizer      1947305      1968944   +1.11%

R=rsc
CC=andybalholm, golang-dev, r
https://golang.org/cl/6305053
2012-06-07 13:05:35 +10:00
Dave Cheney 6423682019 test/bench/go1: add go/parser benchmark
As discussed in

https://groups.google.com/d/msg/golang-dev/Na9XE6mcQyY/zbeBI7R-vnoJ

Here is a static copy of the go/parser benchmark. I ended up using
fancy encodings because the original parser.go had a number of `s
scattered throughout which made it hard to embed the source directly.

Curiously on my laptop this benchmark always scores roughly 10% higher
than the standalone benchmark. This may be down to the generation of
the fasta data set triggering the cpu governor to raise the cpu speed.
However the benchmark is consistent with itself across multiple runs.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6305055
2012-06-07 10:23:45 +10:00
Alex Brainman f54d61061c runtime: include "typekind.h" to fix windows build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6305059
2012-06-07 09:37:05 +10:00