]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agocmd/api: add exception file
Rob Pike [Thu, 4 Oct 2012 01:35:17 +0000 (11:35 +1000)]
cmd/api: add exception file
Fixes build.

R=golang-dev, adg, bradfitz, dsymonds, dave
CC=golang-dev
https://golang.org/cl/6586074

12 years agogodoc: show contents in correct order, expand sections on click
Andrew Gerrand [Thu, 4 Oct 2012 01:21:37 +0000 (11:21 +1000)]
godoc: show contents in correct order, expand sections on click

R=dsymonds
CC=gobot, golang-dev
https://golang.org/cl/6588079

12 years agogo/doc: add nil to list of predeclared constants
Andrew Gerrand [Wed, 3 Oct 2012 22:37:48 +0000 (08:37 +1000)]
go/doc: add nil to list of predeclared constants

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6601054

12 years agogo/doc: rewrite whole file examples for playground
Andrew Gerrand [Wed, 3 Oct 2012 21:55:24 +0000 (07:55 +1000)]
go/doc: rewrite whole file examples for playground

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6592061

12 years agogo spec: conversion types starting with "func" must be parenthesized
Robert Griesemer [Wed, 3 Oct 2012 20:46:37 +0000 (13:46 -0700)]
go spec: conversion types starting with "func" must be parenthesized

Also: Be explicit what operator means with respect to conversion types.

The parenthesis requirement is a language change. At the moment,
literal function types in conversions that cannot possibly be
followed by a '(' don't need parentheses. For instance:

        func(int)int(x)  ->  same as (func(int)int)(x)
        func()()(x)      ->  same as (func())(x)

but:

        func(int)(x)  ->  could be func(int)x {...}

Fixes #4109.

R=rsc, r, iant, ken, iant
CC=golang-dev
https://golang.org/cl/6584065

12 years agomisc/dashboard: set charset utf-8 on build log downloads
Brad Fitzpatrick [Wed, 3 Oct 2012 15:16:27 +0000 (08:16 -0700)]
misc/dashboard: set charset utf-8 on build log downloads

Fixes #4187

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6587071

12 years agogodoc: move Examples above Index and make them both collapsable
Andrew Gerrand [Wed, 3 Oct 2012 05:05:08 +0000 (15:05 +1000)]
godoc: move Examples above Index and make them both collapsable

R=golang-dev, dsymonds, bradfitz, r
CC=golang-dev
https://golang.org/cl/6591066

12 years agotesting: update package docs to use ResetTimer() instead of StopTimer/StartTimer()
Shenghou Ma [Wed, 3 Oct 2012 03:41:18 +0000 (11:41 +0800)]
testing: update package docs to use ResetTimer() instead of StopTimer/StartTimer()

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/6591051

12 years agotext/template: better error messages during execution,
Rob Pike [Wed, 3 Oct 2012 02:02:13 +0000 (12:02 +1000)]
text/template: better error messages during execution,
They now show the correct name, the byte offset on the line, and context for the failed evaluation.
Before:
        template: three:7: error calling index: index out of range: 5
After:
        template: top:7:20: executing "three" at <index "hi" $>: error calling index: index out of range: 5
Here top is the template that was parsed to create the set, and the error appears with the action
starting at byte 20 of line 7 of "top", inside the template called "three", evaluating the expression
<index "hi" $>.

Also fix a bug in index: it didn't work on strings. Ouch.

Also fix bug in error for index: was showing type of index not slice.
The real previous error was:
        template: three:7: error calling index: can't index item of type int
The html/template package's errors can be improved by building on this;
I'll do that in a separate pass.

Extends the API for text/template/parse but only by addition of a field and method. The
old API still works.

Fixes #3188.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6576058

12 years agogo/ast: track position of <- for channel types
Robert Griesemer [Wed, 3 Oct 2012 00:50:36 +0000 (17:50 -0700)]
go/ast: track position of <- for channel types

This is a backward-compatible API change.

Without the correct <- position information,
certain channel types have incorrect position
information.

R=iant, iant
CC=golang-dev
https://golang.org/cl/6585063

12 years agoos/user : use username as fullname if all else fails (on windows)
Shivakumar GN [Wed, 3 Oct 2012 00:33:09 +0000 (10:33 +1000)]
os/user : use username as fullname if all else fails (on windows)

Fixes #4113.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6545054

12 years agogo/parser: correctly parse <-chan T(x) as <-(chan T)(x)
Robert Griesemer [Tue, 2 Oct 2012 23:48:30 +0000 (16:48 -0700)]
go/parser: correctly parse <-chan T(x) as <-(chan T)(x)

Fixes #4110.

R=iant
CC=golang-dev
https://golang.org/cl/6597069

12 years agocodereview.py: suggest installing Mercurial from official website
Robert Hencke [Tue, 2 Oct 2012 20:58:24 +0000 (06:58 +1000)]
codereview.py: suggest installing Mercurial from official website

Continuation of https://golang.org/cl/6499053/

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6584059

12 years agocmd/8g: do not take the address of string/slice for &s[i]
Rémy Oudompheng [Tue, 2 Oct 2012 06:19:27 +0000 (08:19 +0200)]
cmd/8g: do not take the address of string/slice for &s[i]

A similar change was made in 6g recently.

LEALs in cmd/go: 31440 before, 27867 after.

benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    7065794000   6723617000   -4.84%
BenchmarkFannkuch11      7767395000   7477945000   -3.73%
BenchmarkGobDecode         34708140     34857820   +0.43%
BenchmarkGobEncode         10998780     10960060   -0.35%
BenchmarkGzip            1603630000   1471052000   -8.27%
BenchmarkGunzip           242573900    240650400   -0.79%
BenchmarkJSONEncode       120842200    117966100   -2.38%
BenchmarkJSONDecode       247254900    249103100   +0.75%
BenchmarkMandelbrot200     29237330     29241790   +0.02%
BenchmarkParse              8111320      8096865   -0.18%
BenchmarkRevcomp         2595780000   2694153000   +3.79%
BenchmarkTemplate         276679600    264497000   -4.40%

benchmark                              old ns/op    new ns/op    delta
BenchmarkAppendFloatDecimal                  429          416   -3.03%
BenchmarkAppendFloat                         780          740   -5.13%
BenchmarkAppendFloatExp                      746          700   -6.17%
BenchmarkAppendFloatNegExp                   752          694   -7.71%
BenchmarkAppendFloatBig                     1228         1108   -9.77%
BenchmarkAppendFloat32Integer                457          416   -8.97%
BenchmarkAppendFloat32ExactFraction          662          631   -4.68%
BenchmarkAppendFloat32Point                  771          735   -4.67%
BenchmarkAppendFloat32Exp                    722          672   -6.93%
BenchmarkAppendFloat32NegExp                 724          659   -8.98%
BenchmarkAppendFloat64Fixed1                 429          400   -6.76%
BenchmarkAppendFloat64Fixed2                 463          442   -4.54%

Update #1914.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/6574043

12 years agorace: gc changes
Dmitriy Vyukov [Tue, 2 Oct 2012 06:05:46 +0000 (10:05 +0400)]
race: gc changes
This is the first part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
This change makes gc compiler instrument memory accesses when supplied with -b flag.

R=rsc, nigeltao, lvd
CC=golang-dev
https://golang.org/cl/6497074

12 years agogo/doc: strip example output comment from synthesized main function
Andrew Gerrand [Mon, 1 Oct 2012 22:35:20 +0000 (08:35 +1000)]
go/doc: strip example output comment from synthesized main function

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6524047

12 years agocmd/5g: avoid temporary during constant binary op
Dave Cheney [Mon, 1 Oct 2012 22:12:39 +0000 (08:12 +1000)]
cmd/5g: avoid temporary during constant binary op

This CL is an attempt to backport the abop code generation from 6g. This improves the generation of the range offset if the increment can be encoded directly via Operand2 shift encoding.

0023 (/home/dfc/src/range.go:7) BGE     ,29(APC)
0024 (/home/dfc/src/range.go:7) MOVW    0(R3),R5
0025 (/home/dfc/src/range.go:7) MOVW    $4,R1
0026 (/home/dfc/src/range.go:7) ADD     R1,R3,R3
0027 (/home/dfc/src/range.go:8) ADD     R5,R4,R4
0028 (/home/dfc/src/range.go:7) B       ,17(APC)

becomes

0023 (/home/dfc/src/range.go:7) BGE     ,28(APC)
0024 (/home/dfc/src/range.go:7) MOVW    0(R3),R0
0025 (/home/dfc/src/range.go:7) ADD     $4,R3,R3
0026 (/home/dfc/src/range.go:8) ADD     R0,R4,R4
0027 (/home/dfc/src/range.go:7) B       ,17(APC)

Benchmarks are unimpressive

dfc@qnap:~/go/test/bench/go1$ ~/go/misc/benchcmp {old,new}.txt
benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    2147483647   2147483647   +0.93%
BenchmarkFannkuch11      2147483647   2147483647   -2.52%
BenchmarkGobDecode        196135200    195842000   -0.15%
BenchmarkGobEncode         78581650     76734450   -2.35%
BenchmarkGzip            2147483647   2147483647   -0.47%
BenchmarkGunzip          1087243000   1070254000   -1.56%
BenchmarkJSONEncode      1107558000   1146077000   +3.48%
BenchmarkJSONDecode      2147483647   2147483647   -0.07%
BenchmarkMandelbrot200   2147483647   2147483647   -0.77%
BenchmarkParse             74328550     71653400   -3.60%
BenchmarkRevcomp          111123900    109325950   -1.62%
BenchmarkTemplate        2147483647   2147483647   -0.82%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkGobDecode             3.91         3.92    1.00x
BenchmarkGobEncode             9.77        10.00    1.02x
BenchmarkGzip                  3.65         3.66    1.00x
BenchmarkGunzip               17.85        18.13    1.02x
BenchmarkJSONEncode            1.75         1.69    0.97x
BenchmarkJSONDecode            0.83         0.83    1.00x
BenchmarkParse                 0.78         0.81    1.04x
BenchmarkRevcomp              22.87        23.25    1.02x
BenchmarkTemplate              0.84         0.85    1.01x

R=remyoudompheng, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6564067

12 years agoarchive/tar: fix inconsistent namespace usage in example
Jeremy Jackins [Mon, 1 Oct 2012 22:10:42 +0000 (08:10 +1000)]
archive/tar: fix inconsistent namespace usage in example

This fixes some example code in the tar package documentation, which
first refers to tar.NewWriter and then to Header, which is inconsistent
because NewWriter and Header are both in the tar namespace.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6595050

12 years agomath/big: avoid some allocation in Exp
Adam Langley [Mon, 1 Oct 2012 21:31:35 +0000 (17:31 -0400)]
math/big: avoid some allocation in Exp

benchmark                        old ns/op    new ns/op    delta
BenchmarkRSA1024Decrypt             745686       644964  -13.51%
BenchmarkRSA2048Decrypt            5517318      5049200   -8.48%
Benchmark3PrimeRSA2048Decrypt      3767386      3288048  -12.72%

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6566043

12 years agocmd/godoc: clearer comments in FormatSelections
Robert Griesemer [Mon, 1 Oct 2012 21:17:25 +0000 (14:17 -0700)]
cmd/godoc: clearer comments in FormatSelections

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6561073

12 years agoA+C: add Jeff Wendling (Individual CLA)
Adam Langley [Mon, 1 Oct 2012 20:49:29 +0000 (16:49 -0400)]
A+C: add Jeff Wendling (Individual CLA)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6596050

12 years agocmd/go/build: Add magic data for Plan 9 binaries.
Akshat Kumar [Mon, 1 Oct 2012 19:04:52 +0000 (15:04 -0400)]
cmd/go/build: Add magic data for Plan 9 binaries.

This change allows the Go build and install tools to
recognize Plan 9 i386 and amd64 binaries.

R=rsc, r, rminnich
CC=golang-dev
https://golang.org/cl/6575064

12 years agocmd/gc: Missing break in esc switch.
Luuk van Dijk [Mon, 1 Oct 2012 14:33:06 +0000 (16:33 +0200)]
cmd/gc: Missing break in esc switch.

R=rsc
CC=golang-dev
https://golang.org/cl/6594053

12 years agopkg/syscall: Plan 9, 64-bit: Update error checks from sys calls.
Akshat Kumar [Mon, 1 Oct 2012 00:09:08 +0000 (10:09 +1000)]
pkg/syscall: Plan 9, 64-bit: Update error checks from sys calls.

This change updates CL 6576057 for exceptional cases where
return values from Syscall/RawSyscall functions are used.

The system calls return 32-bit integers. With the recent change
in size of `int' in Go for amd64, the type conversion was not
catching `-1' return values. This change makes the conversion
explicitly `int32'.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6590047

12 years agotest/fixedbugs: forgotten test cases for issues 3907 and 4156.
Rémy Oudompheng [Sun, 30 Sep 2012 08:35:09 +0000 (10:35 +0200)]
test/fixedbugs: forgotten test cases for issues 3907 and 4156.

Update #3907.
Update #4156.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6595044

12 years agoexp/types: permit importing packages without available source.
David Symonds [Sun, 30 Sep 2012 05:56:23 +0000 (15:56 +1000)]
exp/types: permit importing packages without available source.

R=gri, iant
CC=golang-dev
https://golang.org/cl/6586051

12 years agoexp/types: better diagnosis for compile failures.
David Symonds [Sun, 30 Sep 2012 05:46:37 +0000 (15:46 +1000)]
exp/types: better diagnosis for compile failures.

R=gri, dave
CC=golang-dev
https://golang.org/cl/6587046

12 years agotest/fixedbugs/bug454.go: add a test for CL 6564052
Shenghou Ma [Sat, 29 Sep 2012 15:23:56 +0000 (23:23 +0800)]
test/fixedbugs/bug454.go: add a test for CL 6564052
   Also mention that ignoring second blank identifier of range is required by the spec in the code.

   Fixes #4173.

R=daniel.morsing, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/6594043

12 years agosyscall: add ipv4 ancillary data for darwin
Mikio Hara [Sat, 29 Sep 2012 03:43:05 +0000 (12:43 +0900)]
syscall: add ipv4 ancillary data for darwin

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6586044

12 years agogo spec: arguments for append may overlap
Robert Griesemer [Fri, 28 Sep 2012 22:55:38 +0000 (15:55 -0700)]
go spec: arguments for append may overlap

Fixes #4142.

R=rsc, r, iant, ken, remyoudompheng
CC=golang-dev
https://golang.org/cl/6567062

12 years agocmd/godoc: fix minor bug in FormatSelections.
Paul Chang [Fri, 28 Sep 2012 21:19:43 +0000 (14:19 -0700)]
cmd/godoc: fix minor bug in FormatSelections.

FormatSelections tries to call a nil function value if lw is nil
and the final entry in the selections array is non-nil. Luckily,
this doesn't actually happen in practice since godoc doesn't use
this combination (no line numbers, but with selections).

R=gri
CC=gobot, golang-dev
https://golang.org/cl/6488106

12 years agoCONTRIBUTORS: added Paul Chang (Google CLA)
Robert Griesemer [Fri, 28 Sep 2012 21:19:31 +0000 (14:19 -0700)]
CONTRIBUTORS: added Paul Chang (Google CLA)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6569078

12 years agocontainer/list: slightly better code factoring
Robert Griesemer [Fri, 28 Sep 2012 17:58:46 +0000 (10:58 -0700)]
container/list: slightly better code factoring

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6569077

12 years agocontainer/list: Correctly maintain internal invariants
Robert Griesemer [Fri, 28 Sep 2012 17:35:32 +0000 (10:35 -0700)]
container/list: Correctly maintain internal invariants

The previous implementation was a mess with invariants
maintained inconsistently. Essentially reimplemented
the package:

- used a circular list as internal representation for
  significantly simpler implementation with fewer
  special cases while maintaining the illusion of
  a nil-terminated doubly linked list externally

- more precise documentation

- cleaned up and simplified tests, added test case
  for issue 4103.

No changes to the API or documented semantics.

All this said, I would be in favor of removing
this package eventually. container/ring provides
a faster implementation and a simpler and more
powerful API.

Fixes #4103.

R=r
CC=golang-dev
https://golang.org/cl/6569072

12 years agotest: match gccgo error messages
Ian Lance Taylor [Fri, 28 Sep 2012 15:30:30 +0000 (08:30 -0700)]
test: match gccgo error messages

const1.go:31:12: error: integer constant overflow
const1.go:31:12: error: integer constant overflow
const1.go:33:12: error: integer constant overflow
const1.go:33:12: error: integer constant overflow
const1.go:34:14: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:35:17: error: integer constant overflow
const1.go:36:19: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:24: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:37:24: error: integer constant overflow
const1.go:37:15: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:38:12: error: integer constant overflow
const1.go:41:20: error: integer constant overflow
const1.go:41:20: error: integer constant overflow
const1.go:42:20: error: integer constant overflow
const1.go:42:20: error: integer constant overflow
const1.go:44:28: error: integer constant overflow
const1.go:44:28: error: integer constant overflow
const1.go:45:14: error: integer constant overflow
const1.go:49:14: error: integer constant overflow
const1.go:50:14: error: integer constant overflow
const1.go:51:14: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:54:23: error: integer constant overflow
const1.go:56:14: error: integer constant overflow
const1.go:57:24: error: integer constant overflow
const1.go:57:24: error: integer constant overflow
const1.go:58:24: error: integer constant overflow
const1.go:58:24: error: integer constant overflow
const1.go:59:22: error: integer constant overflow
const1.go:59:22: error: integer constant overflow
const1.go:61:24: error: integer constant overflow
const1.go:62:20: error: division by zero
const1.go:65:19: error: floating point constant overflow
const1.go:65:19: error: floating point constant overflow
const1.go:66:28: error: floating point constant overflow
const1.go:66:28: error: floating point constant overflow
const1.go:67:19: error: floating point constant overflow
const1.go:67:19: error: floating point constant overflow
const1.go:68:19: error: division by zero
const1.go:33:14: error: integer constant overflow
const1.go:35:19: error: integer constant overflow
const1.go:42:22: error: integer constant overflow
const1.go:53:17: error: integer constant overflow
const1.go:55:14: error: integer constant overflow
const1.go:59:24: error: integer constant overflow
const1.go:69:20: error: expected integer type
const1.go:75:4: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:76:4: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:77:4: error: argument 1 has incompatible type (cannot use type uint8 as type int)
const1.go:79:4: error: argument 1 has incompatible type (cannot use type float32 as type int)
const1.go:80:4: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:81:4: error: floating point constant truncated to integer
const1.go:83:4: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:84:4: error: argument 1 has incompatible type (cannot use type string as type int)
const1.go:85:4: error: argument 1 has incompatible type (cannot use type bool as type int)
const1.go:88:7: error: const initializer cannot be nil

const2.go:14:8: error: expected ‘=’

const5.go:27:7: error: expression is not constant
const5.go:28:7: error: expression is not constant
const5.go:30:7: error: expression is not constant
const5.go:31:7: error: expression is not constant

ddd1.go:57:23: error: invalid use of ‘...’ in type conversion
ddd1.go:59:6: error: invalid use of ‘...’ in type conversion
ddd1.go:60:12: error: use of ‘[...]’ outside of array literal
ddd1.go:21:15: error: argument 1 has incompatible type
ddd1.go:22:10: error: argument 1 has incompatible type
ddd1.go:30:6: error: invalid use of ‘...’ with non-slice
ddd1.go:30:6: error: invalid use of ‘...’ with non-slice
ddd1.go:46:2: error: invalid use of %<...%> with builtin function
ddd1.go:47:2: error: invalid use of %<...%> with builtin function
ddd1.go:49:2: error: invalid use of %<...%> with builtin function
ddd1.go:50:6: error: invalid use of %<...%> with builtin function
ddd1.go:51:6: error: invalid use of %<...%> with builtin function
ddd1.go:53:6: error: invalid use of %<...%> with builtin function
ddd1.go:58:13: error: invalid use of %<...%> with builtin function
ddd1.go:20:10: error: floating point constant truncated to integer
ddd1.go:32:6: error: invalid use of ‘...’ calling non-variadic function

declbad.go:20:3: error: variables redeclared but no variable is new
declbad.go:38:3: error: variables redeclared but no variable is new
declbad.go:44:3: error: variables redeclared but no variable is new
declbad.go:51:3: error: variables redeclared but no variable is new
declbad.go:57:3: error: variables redeclared but no variable is new
declbad.go:63:3: error: variables redeclared but no variable is new
declbad.go:26:3: error: incompatible types in assignment (cannot use type float32 as type int)
declbad.go:32:3: error: incompatible types in assignment (cannot use type int as type float32)
declbad.go:44:3: error: incompatible types in assignment (different number of results)

fixedbugs/bug223.go:21:5: error: initialization expression for ‘m’ depends upon itself

fixedbugs/bug412.go:10:2: error: duplicate field name ‘x’

fixedbugs/bug413.go:11:5: error: initialization expression for ‘i’ depends upon itself

fixedbugs/bug416.go:13:1: error: method ‘X’ redeclares struct field name

fixedbugs/bug435.go:15:49: error: missing ‘)’
fixedbugs/bug435.go:15:2: error: reference to undefined name ‘bar’

fixedbugs/bug451.go:9:9: error: expected package

typeswitch3.go:39:9: error: no new variables on left side of ‘:=’
typeswitch3.go:24:2: error: impossible type switch case (type has no methods)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6560063

12 years agostrings: implement a faster single-string Replacer
Eric Roshan-Eisner [Fri, 28 Sep 2012 02:34:18 +0000 (12:34 +1000)]
strings: implement a faster single-string Replacer

The string searching is implemented separately so other functions
may make use of it in the future.

benchmark                        old ns/op    new ns/op    delta
BenchmarkSingleMaxSkipping          125889         2474  -98.03%
BenchmarkSingleLongSuffixFail        16252         1996  -87.72%
BenchmarkSingleMatch                260793       136266  -47.75%

benchmark                         old MB/s     new MB/s  speedup
BenchmarkSingleMaxSkipping           79.43      4041.57   50.88x
BenchmarkSingleLongSuffixFail        61.65       501.81    8.14x
BenchmarkSingleMatch                 57.52       110.08    1.91x

R=nigeltao
CC=golang-dev
https://golang.org/cl/6545049

12 years agotesting: remove redundant whitespace in output
Eric Roshan-Eisner [Fri, 28 Sep 2012 00:01:09 +0000 (10:01 +1000)]
testing: remove redundant whitespace in output

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6565061

12 years agopkg/syscall: Plan 9, 64-bit: Update error checks from sys calls.
Akshat Kumar [Thu, 27 Sep 2012 23:56:44 +0000 (09:56 +1000)]
pkg/syscall: Plan 9, 64-bit: Update error checks from sys calls.

The system calls return 32-bit integers. With the recent change
in size of `int' in Go for amd64, the type conversion was not
catching `-1' return values. This change makes the conversion
explicitly `int32'.

R=rsc, rminnich, npe, r
CC=golang-dev
https://golang.org/cl/6576057

12 years agodoc: clarify that the displayed tar file name is an example
Andrew Gerrand [Thu, 27 Sep 2012 22:34:18 +0000 (15:34 -0700)]
doc: clarify that the displayed tar file name is an example

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/6573065

12 years agodoc: fix OS X download links
Andrew Gerrand [Thu, 27 Sep 2012 21:48:33 +0000 (14:48 -0700)]
doc: fix OS X download links

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6566064

12 years agocmd/[568]g: header cleanup.
Rémy Oudompheng [Thu, 27 Sep 2012 06:34:00 +0000 (08:34 +0200)]
cmd/[568]g: header cleanup.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6573059

12 years agobufio: Implement io.WriterTo for (*Reader)
Michael Chaten [Thu, 27 Sep 2012 06:31:03 +0000 (16:31 +1000)]
bufio: Implement io.WriterTo for (*Reader)

This is part 1 of 2 for issue 4028

benchmark                       old ns/op    new ns/op    delta
BenchmarkReaderCopyOptimal          33495         9849  -70.60%
BenchmarkReaderCopyUnoptimal        70631        27041  -61.72%
BenchmarkReaderCopyOldImpl          51407        52970   +3.04%

Update #4028

R=dave, nigeltao, rsc, bradfitz, rogpeppe
CC=golang-dev
https://golang.org/cl/6548047

12 years agotext/template: fix typo of errorf as error in comment.
Josh Holland [Thu, 27 Sep 2012 05:47:54 +0000 (15:47 +1000)]
text/template: fix typo of errorf as error in comment.

R=r, minux.ma
CC=gobot, golang-dev
https://golang.org/cl/6506120

12 years agoCLA: Josh Holland <jrh@joshh.co.uk> individual contributor
Rob Pike [Thu, 27 Sep 2012 05:47:18 +0000 (15:47 +1000)]
CLA: Josh Holland <jrh@joshh.co.uk> individual contributor

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6568059

12 years agocmd/api: delete redundant text from deletion message
Rob Pike [Thu, 27 Sep 2012 05:39:56 +0000 (15:39 +1000)]
cmd/api: delete redundant text from deletion message

R=bradfitz, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6543064

12 years agolzw: fix Write returning the wrong number of bytes written.
Nigel Tao [Thu, 27 Sep 2012 03:29:39 +0000 (13:29 +1000)]
lzw: fix Write returning the wrong number of bytes written.

Fixes #4160.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6564060

12 years agofmt: allow # and x together for strings
Rob Pike [Wed, 26 Sep 2012 20:21:38 +0000 (06:21 +1000)]
fmt: allow # and x together for strings
Silly and small but easy to be consistent.
To make it worthwhile, I eliminated an allocation when using
%x on a byte slice.

Fixes #4149.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6574046

12 years agonet: spread fd over several pollservers.
Sébastien Paolacci [Wed, 26 Sep 2012 19:32:59 +0000 (15:32 -0400)]
net: spread fd over several pollservers.

Lighten contention without preventing further improvements on pollservers.
Connections are spread over Min(GOMAXPROCS, NumCPU, 8) pollserver instances.

Median of 10 runs, 4 cores @ 3.4GHz, amd/linux-3.2:

BenchmarkTCPOneShot                171917 ns/op   175194 ns/op      1.91%
BenchmarkTCPOneShot-2              101413 ns/op   109462 ns/op      7.94%
BenchmarkTCPOneShot-4               91796 ns/op    35712 ns/op    -61.10%
BenchmarkTCPOneShot-6               90938 ns/op    30607 ns/op    -66.34%
BenchmarkTCPOneShot-8               90374 ns/op    29150 ns/op    -67.75%
BenchmarkTCPOneShot-16             101089 ns/op   111526 ns/op     10.32%

BenchmarkTCPOneShotTimeout         174986 ns/op   178606 ns/op      2.07%
BenchmarkTCPOneShotTimeout-2       101585 ns/op   110678 ns/op      8.95%
BenchmarkTCPOneShotTimeout-4        91547 ns/op    35931 ns/op    -60.75%
BenchmarkTCPOneShotTimeout-6        91496 ns/op    31019 ns/op    -66.10%
BenchmarkTCPOneShotTimeout-8        90670 ns/op    29531 ns/op    -67.43%
BenchmarkTCPOneShotTimeout-16      101013 ns/op   106026 ns/op      4.96%

BenchmarkTCPPersistent              51731 ns/op    53324 ns/op      3.08%
BenchmarkTCPPersistent-2            32888 ns/op    30678 ns/op     -6.72%
BenchmarkTCPPersistent-4            25751 ns/op    15595 ns/op    -39.44%
BenchmarkTCPPersistent-6            26737 ns/op     9805 ns/op    -63.33%
BenchmarkTCPPersistent-8            26850 ns/op     9730 ns/op    -63.76%
BenchmarkTCPPersistent-16          104449 ns/op   102838 ns/op     -1.54%

BenchmarkTCPPersistentTimeout       51806 ns/op    53281 ns/op      2.85%
BenchmarkTCPPersistentTimeout-2     32956 ns/op    30895 ns/op     -6.25%
BenchmarkTCPPersistentTimeout-4     25994 ns/op    18111 ns/op    -30.33%
BenchmarkTCPPersistentTimeout-6     26679 ns/op     9846 ns/op    -63.09%
BenchmarkTCPPersistentTimeout-8     26810 ns/op     9727 ns/op    -63.72%
BenchmarkTCPPersistentTimeout-16   101652 ns/op   104410 ns/op      2.71%

R=rsc, dvyukov, dave, mikioh.mikioh, bradfitz, remyoudompheng
CC=golang-dev
https://golang.org/cl/6496054

12 years agocmd/6g, cmd/8g: fix two "out of fixed registers" cases.
Rémy Oudompheng [Wed, 26 Sep 2012 19:17:11 +0000 (21:17 +0200)]
cmd/6g, cmd/8g: fix two "out of fixed registers" cases.

In two cases, registers were allocated too early resulting
in exhausting of available registers when nesting these
operations.

The case of method calls was due to missing cases in igen,
which only makes calls but doesn't allocate a register for
the result.

The case of 8-bit multiplication was due to a wrong order
in register allocation when Ullman numbers were bigger on the
RHS.

Fixes #3907.
Fixes #4156.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/6560054

12 years agocmd/gc: Don't calculate second value in range if it is blank.
Daniel Morsing [Wed, 26 Sep 2012 19:10:29 +0000 (21:10 +0200)]
cmd/gc: Don't calculate second value in range if it is blank.

Low hanging fruit optimization. Will remove an expensive copy if the range variable is an array.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6564052

12 years agocrypto/x509: add Plan 9 root certificate location
David du Colombier [Wed, 26 Sep 2012 18:47:47 +0000 (14:47 -0400)]
crypto/x509: add Plan 9 root certificate location

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/6571056

12 years agodoc: add important info for would-be go contributors.
Jonathan Feinberg [Wed, 26 Sep 2012 18:39:31 +0000 (14:39 -0400)]
doc: add important info for would-be go contributors.

Link to the "installing from source" docs instead of the "installing" docs.

Remind would-be hacker to switch to the default branch from the release branch.

R=rsc
CC=golang-dev
https://golang.org/cl/6559043

12 years agocrypto/aes: speed up using AES-NI on amd64
Shenghou Ma [Wed, 26 Sep 2012 17:54:10 +0000 (01:54 +0800)]
crypto/aes: speed up using AES-NI on amd64

This CL requires CL 5970055.

benchmark           old ns/op    new ns/op    delta
BenchmarkEncrypt          161           23  -85.71%
BenchmarkDecrypt          158           24  -84.24%
BenchmarkExpand           526           62  -88.21%

benchmark            old MB/s     new MB/s  speedup
BenchmarkEncrypt        99.32       696.19    7.01x
BenchmarkDecrypt       100.93       641.56    6.36x

R=golang-dev, bradfitz, dave, rsc
CC=golang-dev
https://golang.org/cl/6549055

12 years agocmd/6a, cmd/6l: add support for AES-NI instrutions and PSHUFD
Shenghou Ma [Wed, 26 Sep 2012 17:53:08 +0000 (01:53 +0800)]
cmd/6a, cmd/6l: add support for AES-NI instrutions and PSHUFD
This CL adds support for the these 7 new instructions to 6a/6l in
preparation of the upcoming CL for AES-NI accelerated crypto/aes:
AESENC, AESENCLAST, AESDEC, AESDECLAST, AESIMC, AESKEYGENASSIST,
and PSHUFD.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5970055

12 years agocodereview: use subprocess.call() instead of os.spawnvp() for portability
Shivakumar GN [Wed, 26 Sep 2012 17:50:59 +0000 (01:50 +0800)]
codereview: use subprocess.call() instead of os.spawnvp() for portability

Fixes #4121.

R=golang-dev, minux.ma, dave, r
CC=golang-dev
https://golang.org/cl/6555049

12 years agospec: permit trailing comma in conversions
Robert Griesemer [Wed, 26 Sep 2012 17:31:57 +0000 (10:31 -0700)]
spec: permit trailing comma in conversions

Also: Adjust prose in Conversions section
to be consistent.

This is a backward-compatible syntax change.
For a discussion see issue 2568.

Fixes #2568.
Fixes #4123.

R=golang-dev, r, iant, rsc
CC=golang-dev
https://golang.org/cl/6572049

12 years agodoc/go1.1: fix metadata json format
Francisco Souza [Wed, 26 Sep 2012 15:49:36 +0000 (08:49 -0700)]
doc/go1.1: fix metadata json format

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6570054

12 years agocmd/go, cmd/ld: fix libgcc order and add __image_base__ symbol for windows
Shenghou Ma [Wed, 26 Sep 2012 14:34:25 +0000 (22:34 +0800)]
cmd/go, cmd/ld: fix libgcc order and add __image_base__ symbol for windows
        Fixes #4063.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/6543066

12 years agocmd/go: assume that code in $GOROOT is up to date
Joel Sing [Wed, 26 Sep 2012 14:00:50 +0000 (00:00 +1000)]
cmd/go: assume that code in $GOROOT is up to date

Do not check compiler/linker timestamps for packages that are in the
$GOROOT. Avoids trying to rebuild non-writable standard packages when
timestamps have not been retained on the Go binaries.

Fixes #4106.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6533053

12 years agoreflect.DeepEqual: rewrite clarification about nil and empty slice.
Rob Pike [Wed, 26 Sep 2012 10:46:49 +0000 (20:46 +1000)]
reflect.DeepEqual: rewrite clarification about nil and empty slice.
The previous version was created by an idiot. This time, Rog Peppe
wrote the text. Thanks, Rog.
(== doesn't work on slices in general, so it makes no sense to
talk about in the context of DeepEqual.)

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6566054

12 years agonet: fix plan 9 build
Mikio Hara [Wed, 26 Sep 2012 07:11:49 +0000 (16:11 +0900)]
net: fix plan 9 build

R=golang-dev, lucio.dere, fshahriar
CC=golang-dev
https://golang.org/cl/6562046

12 years agoreflect.DeepEqual: document that empty and nil are unequal for slices
Rob Pike [Wed, 26 Sep 2012 05:21:07 +0000 (15:21 +1000)]
reflect.DeepEqual: document that empty and nil are unequal for slices

Update #4133.
Added a sentence of documentation to call out the behavior.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6572051

12 years agoexp/types/staging: updated gcimporter
Robert Griesemer [Wed, 26 Sep 2012 00:39:02 +0000 (17:39 -0700)]
exp/types/staging: updated gcimporter

Mostly minor changes to match the new
definitions in types.go and const.go.

R=rsc, r
CC=golang-dev
https://golang.org/cl/6506101

12 years agoexp/types/staging: support for typechecking (most) builtins
Robert Griesemer [Wed, 26 Sep 2012 00:38:43 +0000 (17:38 -0700)]
exp/types/staging: support for typechecking (most) builtins

This code relies on some functions that are not yet in staging,
but it get's harder to keep all this in sync in a piece-meal
fashion.

R=rsc
CC=golang-dev
https://golang.org/cl/6492124

12 years agoexp/types/staging: operands, constants, and error handling
Robert Griesemer [Wed, 26 Sep 2012 00:38:22 +0000 (17:38 -0700)]
exp/types/staging: operands, constants, and error handling

More pieces of the typechecker code:

- Operands are temporary objects representing an expressions's
type and value (for constants). An operand is the equivalent of
an "attribute" in attribute grammars except that it's not stored
but only passed around during type checking.

- Constant operations are implemented in const.go. Constants are
represented as bool (booleans), int64 and *big.Int (integers),
*big.Rat (floats), complex (complex numbers), and string (strings).

- Error reporting is consolidated in errors.go. Only the first
dozen of lines is new code, the rest of the file contains the
exprString and typeString functions formerly in two separate
files (which have been removed).

This is a replacement CL for 6492101 (which was created without
proper use of hg).

R=rsc, r
CC=golang-dev
https://golang.org/cl/6500114

12 years agonet/http: use tls host instead of proxy, when checking against a certificate
Christian Himpel [Tue, 25 Sep 2012 16:22:13 +0000 (09:22 -0700)]
net/http: use tls host instead of proxy, when checking against a certificate

Fixes #4152.

R=bradfitz
CC=golang-dev
https://golang.org/cl/6570045

12 years agosyscall: do not use int to test network syscall results (on windows)
Alex Brainman [Tue, 25 Sep 2012 07:06:39 +0000 (17:06 +1000)]
syscall: do not use int to test network syscall results (on windows)

Fixes #4147.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6569050

12 years agocmd/5c: fix dataflag annotation
Shenghou Ma [Tue, 25 Sep 2012 06:42:44 +0000 (14:42 +0800)]
cmd/5c: fix dataflag annotation

file        old_size     new_size    base@c1ce95068533
bin/go      14717392     6287824     5918236

this huge size difference is due to GC data for runtime.mheap
(NOPTR dataflag is not obeyed).

R=rsc, dave
CC=golang-dev
https://golang.org/cl/6547051

12 years agotest/bench/shootout: new data after 64-bit ints for amd64
Rob Pike [Tue, 25 Sep 2012 04:14:26 +0000 (14:14 +1000)]
test/bench/shootout: new data after 64-bit ints for amd64

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6564046

12 years agocmd/dist: new version for string for development branch
Russ Cox [Tue, 25 Sep 2012 01:35:20 +0000 (21:35 -0400)]
cmd/dist: new version for string for development branch

Remove VERSION, which was forcing version to 'devel'.

Old:
$ go version
go version devel

New:
$ go version
go version devel +0a3866d6cc6b Mon Sep 24 20:08:05 2012 -0400

The date and time (and time zone) is that of the most recent commit,
not the time of the build itself. With some effort we could normalize
the zone, but I don't think it's worth the effort (more C coding,
since Mercurial is unhelpful).

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/6569049

12 years agobuild: make int 64 bits on amd64
Russ Cox [Tue, 25 Sep 2012 00:57:01 +0000 (20:57 -0400)]
build: make int 64 bits on amd64

The assembly offsets were converted mechanically using
code.google.com/p/rsc/cmd/asmlint. The instruction
changes were done by hand.

Fixes #2188.

R=iant, r, bradfitz, remyoudompheng
CC=golang-dev
https://golang.org/cl/6550058

12 years agoruntime: add types to MSpan
Jan Ziak [Tue, 25 Sep 2012 00:08:05 +0000 (20:08 -0400)]
runtime: add types to MSpan

R=rsc
CC=golang-dev
https://golang.org/cl/6554060

12 years agoreflect: add MakeFunc (API CHANGE)
Russ Cox [Tue, 25 Sep 2012 00:06:32 +0000 (20:06 -0400)]
reflect: add MakeFunc (API CHANGE)

Fixes #1765.

R=iant, r, daniel.morsing, minux.ma, bradfitz, rogpeppe, remyoudompheng
CC=golang-dev
https://golang.org/cl/6554067

12 years agonet: add read, write message methods to IPConn, UDPConn
Mikio Hara [Mon, 24 Sep 2012 21:57:32 +0000 (06:57 +0900)]
net: add read, write message methods to IPConn, UDPConn

Both methods allow to access the IP ancillary data through
socket control messages.

This CL is required for CL 6482044; go.net/ipv4: new package.

R=rsc, r, dave
CC=golang-dev
https://golang.org/cl/6426047

12 years agocmd/{5g,6g,8g,6c}: remove unused macro, use %E to print etype.
Rémy Oudompheng [Mon, 24 Sep 2012 21:44:00 +0000 (23:44 +0200)]
cmd/{5g,6g,8g,6c}: remove unused macro, use %E to print etype.

R=golang-dev, rsc, dave
CC=golang-dev
https://golang.org/cl/6569044

12 years agocmd/6g, cmd/8g: add OINDREG, ODOT, ODOTPTR cases to igen.
Rémy Oudompheng [Mon, 24 Sep 2012 21:07:44 +0000 (23:07 +0200)]
cmd/6g, cmd/8g: add OINDREG, ODOT, ODOTPTR cases to igen.

Apart from reducing the number of LEAL/LEAQ instructions by about
30%, it gives 8g easier registerization in several cases,
for example in strconv. Performance with 6g is not affected.

Before (386):
src/pkg/strconv/decimal.go:22   TEXT  (*decimal).String+0(SB),$240-12
src/pkg/strconv/extfloat.go:540 TEXT  (*extFloat).ShortestDecimal+0(SB),$584-20

After (386):
src/pkg/strconv/decimal.go:22   TEXT  (*decimal).String+0(SB),$196-12
src/pkg/strconv/extfloat.go:540 TEXT  (*extFloat).ShortestDecimal+0(SB),$420-20

Benchmarks with GOARCH=386 (on a Core 2).

benchmark                 old ns/op    new ns/op    delta
BenchmarkBinaryTree17    7110191000   7079644000   -0.43%
BenchmarkFannkuch11      7769274000   7766514000   -0.04%
BenchmarkGobDecode         33454820     34755400   +3.89%
BenchmarkGobEncode         11675710     11007050   -5.73%
BenchmarkGzip            2013519000   1593855000  -20.84%
BenchmarkGunzip           253368200    242667600   -4.22%
BenchmarkJSONEncode       152443900    120763400  -20.78%
BenchmarkJSONDecode       304112800    247461800  -18.63%
BenchmarkMandelbrot200     29245520     29240490   -0.02%
BenchmarkParse              8484105      8088660   -4.66%
BenchmarkRevcomp         2695688000   2841263000   +5.40%
BenchmarkTemplate         363759800    277271200  -23.78%

benchmark                       old ns/op    new ns/op    delta
BenchmarkAtof64Decimal                127          129   +1.57%
BenchmarkAtof64Float                  166          164   -1.20%
BenchmarkAtof64FloatExp               308          300   -2.60%
BenchmarkAtof64Big                    584          571   -2.23%
BenchmarkAppendFloatDecimal           440          430   -2.27%
BenchmarkAppendFloat                  995          776  -22.01%
BenchmarkAppendFloatExp               897          746  -16.83%
BenchmarkAppendFloatNegExp            900          752  -16.44%
BenchmarkAppendFloatBig              1528         1228  -19.63%
BenchmarkAppendFloat32Integer         443          453   +2.26%
BenchmarkAppendFloat32ExactFraction   812          661  -18.60%
BenchmarkAppendFloat32Point          1002          773  -22.85%
BenchmarkAppendFloat32Exp             858          725  -15.50%
BenchmarkAppendFloat32NegExp          848          728  -14.15%
BenchmarkAppendFloat64Fixed1          447          431   -3.58%
BenchmarkAppendFloat64Fixed2          480          462   -3.75%
BenchmarkAppendFloat64Fixed3          461          457   -0.87%
BenchmarkAppendFloat64Fixed4          509          484   -4.91%

Update #1914.

R=rsc, nigeltao
CC=golang-dev, remy
https://golang.org/cl/6494107

12 years agocrypto/tls: support session ticket resumption.
Adam Langley [Mon, 24 Sep 2012 20:52:43 +0000 (16:52 -0400)]
crypto/tls: support session ticket resumption.

Session resumption saves a round trip and removes the need to perform
the public-key operations of a TLS handshake when both the client and
server support it (which is true of Firefox and Chrome, at least).

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6555051

12 years agotesting: document -test.bench flag
Francesc Campoy [Mon, 24 Sep 2012 20:05:47 +0000 (13:05 -0700)]
testing: document -test.bench flag

Fixes #4080.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/6553068

12 years agocmd/gc: fix escape analysis bug
Russ Cox [Mon, 24 Sep 2012 19:53:12 +0000 (15:53 -0400)]
cmd/gc: fix escape analysis bug

Was not handling &x.y[0] and &x.y.z correctly where
y is an array or struct-valued field (not a pointer).

R=ken2
CC=golang-dev
https://golang.org/cl/6551059

12 years agoregexp/syntax: define accepted syntax
Russ Cox [Mon, 24 Sep 2012 19:33:53 +0000 (15:33 -0400)]
regexp/syntax: define accepted syntax

Update #3953.

R=bradfitz, campoy
CC=golang-dev
https://golang.org/cl/6543068

12 years agocmd/8g: don't create redundant temporaries in bgen.
Rémy Oudompheng [Mon, 24 Sep 2012 19:29:24 +0000 (21:29 +0200)]
cmd/8g: don't create redundant temporaries in bgen.

Comparisons used to create temporaries for arguments
even if they were already variables or addressable.
Removing the extra ones reduces pressure on regopt.

benchmark                 old ns/op    new ns/op    delta
BenchmarkGobDecode         50787620     49908980   -1.73%
BenchmarkGobEncode         19870190     19473030   -2.00%
BenchmarkGzip            3214321000   3067929000   -4.55%
BenchmarkGunzip           496792800    465828600   -6.23%
BenchmarkJSONEncode       232524800    263864400  +13.48%
BenchmarkJSONDecode       622038400    506600600  -18.56%
BenchmarkMandelbrot200     23937310     45913060  +91.81%
BenchmarkParse             14364450     13997010   -2.56%
BenchmarkRevcomp         6919028000   6480009000   -6.35%
BenchmarkTemplate         594458800    539528200   -9.24%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkGobDecode            15.11        15.38    1.02x
BenchmarkGobEncode            38.63        39.42    1.02x
BenchmarkGzip                  6.04         6.33    1.05x
BenchmarkGunzip               39.06        41.66    1.07x
BenchmarkJSONEncode            8.35         7.35    0.88x
BenchmarkJSONDecode            3.12         3.83    1.23x
BenchmarkParse                 4.03         4.14    1.03x
BenchmarkRevcomp              36.73        39.22    1.07x
BenchmarkTemplate              3.26         3.60    1.10x

R=mtj, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/6547064

12 years agotesting: add memory allocation stats to benchmark
Eric Roshan-Eisner [Mon, 24 Sep 2012 19:03:16 +0000 (15:03 -0400)]
testing: add memory allocation stats to benchmark

R=rsc, nigeltao, dave, bradfitz, r, rogpeppe
CC=golang-dev
https://golang.org/cl/6497084

12 years agocmd/gc: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:59:44 +0000 (14:59 -0400)]
cmd/gc: prepare for 64-bit ints

This CL makes the compiler understand that the type of
the len or cap of a map, slice, or string is 'int', not 'int32'.
It does not change the meaning of int, but it should make
the eventual change of the meaning of int in 6g a bit smoother.

Update #2188.

R=ken, dave, remyoudompheng
CC=golang-dev
https://golang.org/cl/6542059

12 years agocmd/ld: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:59:09 +0000 (14:59 -0400)]
cmd/ld: prepare for 64-bit ints

Use explicit IntSize constant instead of 4.

This CL does not change the meaning of int, but it should make
the eventual change of the meaning of int on amd64 a bit
smoother.

Update #2188.

R=ken, dave
CC=golang-dev
https://golang.org/cl/6554076

12 years agocmd/cgo: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:58:57 +0000 (14:58 -0400)]
cmd/cgo: prepare for 64-bit ints

This CL makes the size of an int controlled by a variable
in cgo instead of hard-coding 4 (or 32 bits) in various places.

Update #2188.

R=iant, r, dave
CC=golang-dev
https://golang.org/cl/6548061

12 years agomisc/cgo: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:58:45 +0000 (14:58 -0400)]
misc/cgo: prepare for 64-bit ints

In a few places, the existing cgo tests assume that a
Go int is the same as a C int. Making int 64 bits wide
on 64-bit platforms violates this assumption.
Change that code to assume that Go int32 and C int
are the same instead. That's still not great, but it's better,
and I am unaware of any systems we run on where it is not true.

Update #2188.

R=iant, r
CC=golang-dev
https://golang.org/cl/6552064

12 years agoruntime: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 18:58:34 +0000 (14:58 -0400)]
runtime: prepare for 64-bit ints

This CL makes the runtime understand that the type of
the len or cap of a map, slice, or string is 'int', not 'int32',
and it is also careful to distinguish between function arguments
and results of type 'int' vs type 'int32'.

In the runtime, the new typedefs 'intgo' and 'uintgo' refer
to Go int and uint. The C types int and uint continue to be
unavailable (cause intentional compile errors).

This CL does not change the meaning of int, but it should make
the eventual change of the meaning of int on amd64 a bit
smoother.

Update #2188.

R=iant, r, dave, remyoudompheng
CC=golang-dev
https://golang.org/cl/6551067

12 years agocmd/[568]g: explain the purpose of various Reg fields.
Rémy Oudompheng [Mon, 24 Sep 2012 18:55:11 +0000 (20:55 +0200)]
cmd/[568]g: explain the purpose of various Reg fields.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/6554062

12 years agoCONTRIBUTORS: add Jonathan Feinberg (Google CLA)
Russ Cox [Mon, 24 Sep 2012 18:36:07 +0000 (14:36 -0400)]
CONTRIBUTORS: add Jonathan Feinberg (Google CLA)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6553067

12 years agotag go1.0.3
Andrew Gerrand [Mon, 24 Sep 2012 18:15:33 +0000 (13:15 -0500)]
tag go1.0.3

R=rsc
CC=golang-dev
https://golang.org/cl/6543069

12 years agolib9/fmt: do not put a main symbol into lib9.a
Russ Cox [Mon, 24 Sep 2012 16:57:05 +0000 (12:57 -0400)]
lib9/fmt: do not put a main symbol into lib9.a

Fixes #4143.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6541064

12 years agoA+C: Add Shivakumar GN (Individual CLA)
Brad Fitzpatrick [Mon, 24 Sep 2012 16:49:31 +0000 (09:49 -0700)]
A+C: Add Shivakumar GN (Individual CLA)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6541062

12 years agocmd/gc: fix comment for caninl
Russ Cox [Mon, 24 Sep 2012 16:30:32 +0000 (12:30 -0400)]
cmd/gc: fix comment for caninl

Was describing an old implementation.

R=ken2
CC=golang-dev
https://golang.org/cl/6553066

12 years agocmd/dist, pkg/runtime: Plan 9, 64-bit: Get PID from TLS; remove use of `_tos'.
Akshat Kumar [Mon, 24 Sep 2012 16:24:45 +0000 (12:24 -0400)]
cmd/dist, pkg/runtime: Plan 9, 64-bit: Get PID from TLS; remove use of `_tos'.

Using offsets from Tos is cumbersome and we've had problems
in the past. Since it's only being used to grab the PID, we'll just
get that from the default TLS instead.

R=rsc, rminnich, npe
CC=golang-dev
https://golang.org/cl/6543049

12 years agoreflect: fix mistake in error message
Russ Cox [Mon, 24 Sep 2012 15:47:27 +0000 (11:47 -0400)]
reflect: fix mistake in error message

Pointed out by James Chalfant after submit of CL 6500065.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/6543067

12 years agoencoding/asn1: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 14:30:37 +0000 (10:30 -0400)]
encoding/asn1: prepare for 64-bit ints

The code was assuming that int = 32 bits. Don't.

Update #2188.

R=agl
CC=golang-dev
https://golang.org/cl/6543063

12 years agocompress/flate: move the history buffer out of the decompressor struct.
Nigel Tao [Mon, 24 Sep 2012 07:58:08 +0000 (17:58 +1000)]
compress/flate: move the history buffer out of the decompressor struct.

I'm not exactly sure why there's a performance gain, but it seems like
an easy win. Maybe it's a cache line thing. Maybe it's that
unsafe.Sizeof(decompressor{}) drops to below unmappedzero, so that
checkref/checkoffset don't need to insert TESTB instructions. Maybe
it's less noise for the conservative garbage collector. Maybe it's
something else.

compress/flate benchmarks:
BenchmarkDecodeDigitsSpeed1e4          378628       349906   -7.59%
BenchmarkDecodeDigitsSpeed1e5         3481976      3204898   -7.96%
BenchmarkDecodeDigitsSpeed1e6        34419500     31750660   -7.75%
BenchmarkDecodeDigitsDefault1e4        362317       335562   -7.38%
BenchmarkDecodeDigitsDefault1e5       3290032      3107624   -5.54%
BenchmarkDecodeDigitsDefault1e6      30542540     28937480   -5.26%
BenchmarkDecodeDigitsCompress1e4       362803       335158   -7.62%
BenchmarkDecodeDigitsCompress1e5      3294512      3114526   -5.46%
BenchmarkDecodeDigitsCompress1e6     30514940     28927090   -5.20%
BenchmarkDecodeTwainSpeed1e4           412818       389521   -5.64%
BenchmarkDecodeTwainSpeed1e5          3475780      3288908   -5.38%
BenchmarkDecodeTwainSpeed1e6         33629640     31931420   -5.05%
BenchmarkDecodeTwainDefault1e4         369736       348850   -5.65%
BenchmarkDecodeTwainDefault1e5        2861050      2721383   -4.88%
BenchmarkDecodeTwainDefault1e6       27120120     25862050   -4.64%
BenchmarkDecodeTwainCompress1e4        372057       350822   -5.71%
BenchmarkDecodeTwainCompress1e5       2855109      2718664   -4.78%
BenchmarkDecodeTwainCompress1e6      26987010     26336030   -2.41%

image/png benchmarks:
BenchmarkDecodeGray               1841839      1802251   -2.15%
BenchmarkDecodeNRGBAGradient      7115318      6933280   -2.56%
BenchmarkDecodeNRGBAOpaque        6135892      6013284   -2.00%
BenchmarkDecodePaletted           1153313      1114302   -3.38%
BenchmarkDecodeRGB                5619404      5511190   -1.93%

R=rsc, r
CC=golang-dev
https://golang.org/cl/6533048

12 years agoexp/locale/collate/tools/colcmp: implementation of colcmp tool used for comparing
Marcel van Lohuizen [Mon, 24 Sep 2012 04:22:03 +0000 (13:22 +0900)]
exp/locale/collate/tools/colcmp: implementation of colcmp tool used for comparing
various implementation of collation.  The tool provides commands for soring,
regressing one implementation against another, and benchmarking.
Currently it includes collation implementations for the Go collator, ICU,
and one using Darwin's CoreFoundation framework.
To avoid building this tool in the default build, the colcmp tag has been
added to all files. This allows other tools/colcmp in this directory (e.g. it may make
sense to move maketables here) to be put in this directory as well.

R=r, rsc, mpvl
CC=golang-dev
https://golang.org/cl/6496118

12 years agotest: prepare for 64-bit ints
Russ Cox [Mon, 24 Sep 2012 04:06:41 +0000 (00:06 -0400)]
test: prepare for 64-bit ints

Minor tweaks to avoid assuming that int is always 32 bits.

Update #2188.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6553062

12 years agotest: minor fixes in run and testlib
Russ Cox [Mon, 24 Sep 2012 04:06:31 +0000 (00:06 -0400)]
test: minor fixes in run and testlib

Can tell this doesn't get run very often, but it is still important
for when you've broken everything else.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6547065