]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agoruntime: support conditional execution in ARM softfloat
Shenghou Ma [Tue, 22 May 2012 18:00:40 +0000 (02:00 +0800)]
runtime: support conditional execution in ARM softfloat
        Fixes #3638.

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

13 years agoundo CL 6112054 / 2eec2501961c
Russ Cox [Tue, 22 May 2012 17:56:40 +0000 (13:56 -0400)]
undo CL 6112054 / 2eec2501961c

Now that we've fixed the Expect: test, this CL should be okay.

««« original CL description
net/http: revert 97d027b3aa68

Revert the following change set:

        changeset:   13018:97d027b3aa68
        user:        Gustavo Niemeyer <gustavo@niemeyer.net>
        date:        Mon Apr 23 22:00:16 2012 -0300
        summary:     net/http: allow clients to disable keep-alive

This broke a test on Windows 64 and somebody else
will have to check.

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

Fixes #3540.

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

13 years agounicode: fix comment about variable types
Russ Cox [Tue, 22 May 2012 17:53:57 +0000 (13:53 -0400)]
unicode: fix comment about variable types

In both the web and command line tool,
the comment is shown after the declaration.
But in the code the comment is obviously before.
Make the text not refer to a specific order.

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

13 years agocmd/gc: export constants in hexadecimal
Jan Ziak [Tue, 22 May 2012 17:53:38 +0000 (13:53 -0400)]
cmd/gc: export constants in hexadecimal

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

13 years agocrypto/md5: faster inner loop, 3x faster overall
Russ Cox [Tue, 22 May 2012 17:53:27 +0000 (13:53 -0400)]
crypto/md5: faster inner loop, 3x faster overall

The speedup is a combination of unrolling/specializing
the actual code and also making the compiler generate better code.

Go 1.0.1 (size: 1239 code + 320 data = 1559 total)
md5.BenchmarkHash1K   1000000    7178 ns/op  142.64 MB/s
md5.BenchmarkHash8K    200000   56834 ns/op  144.14 MB/s

Partial unroll  (size: 1115 code + 256 data = 1371 total)
md5.BenchmarkHash1K   5000000    2513 ns/op  407.37 MB/s
md5.BenchmarkHash8K    500000   19406 ns/op  422.13 MB/s

Complete unroll  (size: 1900 code + 0 data = 1900 code)
md5.BenchmarkHash1K   5000000    2442 ns/op  419.18 MB/s
md5.BenchmarkHash8K    500000   18957 ns/op  432.13 MB/s

Comparing Go 1.0.1 and the complete unroll (this CL):

benchmark               old MB/s     new MB/s  speedup
md5.BenchmarkHash1K       142.64       419.18    2.94x
md5.BenchmarkHash8K       144.14       432.13    3.00x

On the same machine, 'openssl speed md5' reports 441 MB/s
and 531 MB/s for our two cases, so this CL is at 90% and 80% of
those speeds, which is at least in the right ballpark.
OpenSSL is using carefully engineered assembly, so we are
unlikely to catch up completely.

Measurements on a Mid-2010 MacPro5,1.

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

13 years agonet/http: refactor body logic in test
Russ Cox [Tue, 22 May 2012 17:46:53 +0000 (13:46 -0400)]
net/http: refactor body logic in test

This just eliminates some duplication.
Also add a pointer to RFC 1122, in case
this comes up again.

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

13 years agoruntime: faster GC sweep phase
Dmitriy Vyukov [Tue, 22 May 2012 17:35:52 +0000 (13:35 -0400)]
runtime: faster GC sweep phase
benchmark                              old ns/op    new ns/op    delta

garbage.BenchmarkParser               3731065750   3715543750   -0.41%
garbage.BenchmarkParser-2             3631299750   3495248500   -3.75%
garbage.BenchmarkParser-4             3386486000   3339353000   -1.39%
garbage.BenchmarkParser-8             3267632000   3286422500   +0.58%
garbage.BenchmarkParser-16            3299203000   3316081750   +0.51%

garbage.BenchmarkTree                  977532888    919453833   -5.94%
garbage.BenchmarkTree-2                919948555    853478000   -7.23%
garbage.BenchmarkTree-4                841329000    790207000   -6.08%
garbage.BenchmarkTree-8                787792777    740380666   -6.01%
garbage.BenchmarkTree-16               899257166    846594555   -5.86%

garbage.BenchmarkTree2                 574876300    571885800   -0.52%
garbage.BenchmarkTree2-2               348162700    345888900   -0.65%
garbage.BenchmarkTree2-4               184912500    179137000   -3.22%
garbage.BenchmarkTree2-8               104243900    103485600   -0.73%
garbage.BenchmarkTree2-16               97269500     85137100  -14.25%

garbage.BenchmarkParserPause           141101976    157746974  +11.80%
garbage.BenchmarkParserPause-2         103096051     83043048  -19.45%
garbage.BenchmarkParserPause-4          52153133     45951111  -11.89%
garbage.BenchmarkParserPause-8          36730190     38901024   +5.91%
garbage.BenchmarkParserPause-16         32678875     29578585   -9.49%

garbage.BenchmarkTreePause              29487065     29648439   +0.55%
garbage.BenchmarkTreePause-2            22443494     21306159   -5.07%
garbage.BenchmarkTreePause-4            15799691     14985647   -5.15%
garbage.BenchmarkTreePause-8            10768112     9531420   -12.97%
garbage.BenchmarkTreePause-16           16329891     15205158   -6.89%

garbage.BenchmarkTree2Pause           2586957240   2577533200   -0.36%
garbage.BenchmarkTree2Pause-2         1683383760   1673923800   -0.56%
garbage.BenchmarkTree2Pause-4         1102860320   1074040280   -2.68%
garbage.BenchmarkTree2Pause-8          902627920    886122400   -1.86%
garbage.BenchmarkTree2Pause-16         856470920    804152320   -6.50%

garbage.BenchmarkParserLastPause       277316000    280839000   +1.25%
garbage.BenchmarkParserLastPause-2     179446000    163687000   -8.78%
garbage.BenchmarkParserLastPause-4     106752000     94144000  -11.81%
garbage.BenchmarkParserLastPause-8      57758000     61640000   +6.72%
garbage.BenchmarkParserLastPause-16     51235000     42552000  -16.95%

garbage.BenchmarkTreeLastPause          45244000     50786000  +12.25%
garbage.BenchmarkTreeLastPause-2        37163000     34654000   -6.75%
garbage.BenchmarkTreeLastPause-4        24178000     21967000   -9.14%
garbage.BenchmarkTreeLastPause-8        20390000     15648000  -30.30%
garbage.BenchmarkTreeLastPause-16       22398000     20180000   -9.90%

garbage.BenchmarkTree2LastPause       5748706000   5718809000   -0.52%
garbage.BenchmarkTree2LastPause-2     3481570000   3458844000   -0.65%
garbage.BenchmarkTree2LastPause-4     1849073000   1791330000   -3.22%
garbage.BenchmarkTree2LastPause-8     1042375000   1034811000   -0.73%
garbage.BenchmarkTree2LastPause-16     972637000    851323000  -14.25%

There is also visible improvement in consumed CPU time:
tree2 -heapsize=8000000000 -cpus=12
before: 248.74user 6.36system 0:52.74elapsed 483%CPU
after:  229.86user 6.33system 0:51.08elapsed 462%CPU
-1.66s of real time, but -18.91s of consumed CPU time

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

13 years agogo/ast: document CommentGroup.Text and add test case.
Robert Griesemer [Tue, 22 May 2012 17:30:35 +0000 (10:30 -0700)]
go/ast: document CommentGroup.Text and add test case.

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

13 years agonet/http: improve TestServerExpect
Brad Fitzpatrick [Tue, 22 May 2012 17:27:34 +0000 (10:27 -0700)]
net/http: improve TestServerExpect

Fail more usefully, and Logf in one place instead of Errorf where
an error is acceptable.

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

13 years agogo/parser: fix comment grouping (day 1 bug)
Robert Griesemer [Tue, 22 May 2012 17:04:34 +0000 (10:04 -0700)]
go/parser: fix comment grouping (day 1 bug)

Comment groups must end at the end of a line (or the
next non-comment token) if the group started on a line
with non-comment tokens.

This is important for correct computation of "lead"
and "line" comments (Doc and Comment fields in AST nodes).

Without this fix, the "line" comment for F1 in the
following example:

type T struct {
     F1 int // comment1
     // comment2
     F2 int
}

is "// comment1// comment2" rather than just "// comment1".

This bug was present from Day 1 but only visible when
looking at export-filtered ASTs where only comments
associated with AST nodes are printed, and only in rare
cases (e.g, in the case above, if F2 where not exported,
godoc would show "// comment2" anyway because it was
considered part of the "line" comment for F1).

The bug fix is very small (parser.go). The bulk of the
changes are additional test cases (parser_test.go).

The fix exposed a caching bug in go/printer via one of the
existing tests, hence the changes to printer.go.

As an aside, the fix removes the the need for empty lines
before an "// Output" comment for some special cases of
code examples (e.g.: src/pkg/strings/example_test.go, Count
example).

No impact on gofmt formatting of src, misc.

Fixes #3139.

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

13 years agogodoc: slightly smarter synopsis extraction
Robert Griesemer [Tue, 22 May 2012 17:04:13 +0000 (10:04 -0700)]
godoc: slightly smarter synopsis extraction

Ignore synopses that start with
"Copyright", "All rights", and "Author".

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

13 years agogo/scanner: strip carriage returns from commments
Robert Griesemer [Tue, 22 May 2012 17:03:53 +0000 (10:03 -0700)]
go/scanner: strip carriage returns from commments

Also:
- cleaned up and simplified TestScan
- added tests for comments containing carriage returns

Fixes #3647.

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

13 years agonet/url: better parsing of urls with @ symbol in authority
Alexey Borzenkov [Tue, 22 May 2012 16:44:24 +0000 (12:44 -0400)]
net/url: better parsing of urls with @ symbol in authority

Fixes #3439

R=r, rsc, dsymonds, n13m3y3r
CC=golang-dev
https://golang.org/cl/6206090

13 years agocmd/6a: delete dead code
Russ Cox [Tue, 22 May 2012 15:42:44 +0000 (11:42 -0400)]
cmd/6a: delete dead code

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

13 years agosyscall: implement nametomib() on netbsd
Joel Sing [Tue, 22 May 2012 15:33:48 +0000 (01:33 +1000)]
syscall: implement nametomib() on netbsd

Implement nametomib() on NetBSD using the CTL_QUERY node discovery
mechanism.

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

13 years agocrypto/x509: Add ECDSA support
Benjamin Black [Tue, 22 May 2012 15:03:59 +0000 (11:03 -0400)]
crypto/x509: Add ECDSA support

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

13 years agocrypto/ecdsa: add full set of NIST test vectors.
Adam Langley [Tue, 22 May 2012 14:33:14 +0000 (10:33 -0400)]
crypto/ecdsa: add full set of NIST test vectors.

This includes the NIST test suite for ECDSA and alters the test to
parse and evaluate it.

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

13 years agocrypto/ecdsa: fix case where p != 0 mod 8 and the hash length < p.
Adam Langley [Tue, 22 May 2012 14:17:39 +0000 (10:17 -0400)]
crypto/ecdsa: fix case where p != 0 mod 8 and the hash length < p.

I made a typo which breaks P-521.

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

13 years agoexp/html: adjust inSelectIM to match spec
Andrew Balholm [Tue, 22 May 2012 05:30:13 +0000 (15:30 +1000)]
exp/html: adjust inSelectIM to match spec

Simplify the flow of control.

Handle EOF, null bytes, <html>, <input>, <keygen>, <textarea>, <script>.

Pass 5 more tests.

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

13 years agocmd/8a, cmd/8l: add BSWAPL
Russ Cox [Tue, 22 May 2012 04:29:07 +0000 (00:29 -0400)]
cmd/8a, cmd/8l: add BSWAPL

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

13 years agocmd/6a, cmd/6l: add BSWAPL, BSWAPQ
Russ Cox [Tue, 22 May 2012 04:12:58 +0000 (00:12 -0400)]
cmd/6a, cmd/6l: add BSWAPL, BSWAPQ

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

13 years agoruntime: relax TestGcSys
Russ Cox [Tue, 22 May 2012 04:07:13 +0000 (00:07 -0400)]
runtime: relax TestGcSys

This fixes occasional 64-bit failures.
Maybe it will fix the 32-bit failures too,
so re-enable on 32-bit for now.

R=golang-dev, bradfitz, r, dvyukov
CC=golang-dev
https://golang.org/cl/6218050

13 years agodebug/elf: Expose entry point from Header in File struct.
Matthew Horsnell [Tue, 22 May 2012 03:29:30 +0000 (23:29 -0400)]
debug/elf: Expose entry point from Header in File struct.
Fixes #3470.

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

13 years agoexp/html: adjust inCellIM to match spec
Andrew Balholm [Tue, 22 May 2012 00:31:08 +0000 (10:31 +1000)]
exp/html: adjust inCellIM to match spec

Clean up flow of control.

Ignore </table>, </tbody>, </tfoot>, </thead>, </tr> if there is not
an appropriate element in table scope.

Pass 3 more tests.

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

13 years agocrypto/rsa: add SHA-224 hash prefix
Russ Cox [Mon, 21 May 2012 18:10:16 +0000 (14:10 -0400)]
crypto/rsa: add SHA-224 hash prefix

http://www.rsa.com/rsalabs/node.asp?id=2125:

NOTE: A new OID has been defined for the combination
of the v1.5 signature scheme and the SHA-224 hash function:
        sha224WithRSAEncryption OBJECT IDENTIFIER ::=
Like the other sha*WithRSAEncryption OIDs in PKCS #1 v2.1,
this OID has NULL parameters.
The DigestInfo encoding for SHA-224 (see Section 9.2, Note 1) is:
        (0x)30 2d 30 0d 06 09 60 86 48 01 65 03 04 02 04 05 00 04 1c || H

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

13 years agonet/http: fix duplicate status code in Response.Write
Brad Fitzpatrick [Mon, 21 May 2012 18:07:27 +0000 (11:07 -0700)]
net/http: fix duplicate status code in Response.Write

Fixes #3636

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

13 years agonet/http: add cookies from jar to POST request.
Volker Dobler [Mon, 21 May 2012 17:57:15 +0000 (10:57 -0700)]
net/http: add cookies from jar to POST request.

The main content of this CL is a test case checking the reported
issue 3511 and a tiny fix for it.  A subsequent CL will refactor
the fix as proposed issue 3511.

Fixes #3511.

R=golang-dev, steven.hartland, bradfitz
CC=golang-dev
https://golang.org/cl/6013049

13 years agonet/http: fix regression and mute known test failure for now
Brad Fitzpatrick [Mon, 21 May 2012 17:39:31 +0000 (10:39 -0700)]
net/http: fix regression and mute known test failure for now

Two tests added in 820ffde8c are expected to fail until the fix
for Issue 3540 goes back in (pending Windows net fixes), so
make those tests just Logf for now, with a TODO to re-enable.

Add a new client test.

Rearrange the transport code to be more readable, and fix the
bug from 820ffde8c where the persistConn was being closed before
the body was fully ready.

Fixes #3644
Updates #1967 (not yet fixed, but should be after Issue 3540)

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

13 years agocmd/6g: allow use of R14, R15 now
Russ Cox [Mon, 21 May 2012 16:59:26 +0000 (12:59 -0400)]
cmd/6g: allow use of R14, R15 now

We stopped reserving them in 2009 or so.

R=ken
CC=golang-dev
https://golang.org/cl/6215061

13 years agonet: reduce dial tests on netbsd
Joel Sing [Sun, 20 May 2012 14:38:14 +0000 (00:38 +1000)]
net: reduce dial tests on netbsd

Add NetBSD to the list of operating systems that have a reduced set
of dial tests.

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

13 years agosyscall: fix SockaddrDatalink on netbsd
Joel Sing [Sun, 20 May 2012 14:13:22 +0000 (00:13 +1000)]
syscall: fix SockaddrDatalink on netbsd

RawSockaddrDatalink and SockaddrDatalink need to match - make Data
have length 12 for both.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6223051

13 years agoexp/html: adjust inRowIM to match spec
Andrew Balholm [Sun, 20 May 2012 04:26:20 +0000 (14:26 +1000)]
exp/html: adjust inRowIM to match spec

Delete cases that just fall down to "anything else" action.

Handle </tbody>, </tfoot>, and </thead>.

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

13 years agonet: fix leak in test
Mikio Hara [Sat, 19 May 2012 01:42:54 +0000 (10:42 +0900)]
net: fix leak in test

Also change the Listner variable name from l to ln.

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

13 years agosyscall: add comment
Mikio Hara [Fri, 18 May 2012 23:35:51 +0000 (08:35 +0900)]
syscall: add comment

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

13 years agonet/http: non-keepalive connections close successfully
James Gray [Fri, 18 May 2012 17:34:37 +0000 (10:34 -0700)]
net/http: non-keepalive connections close successfully

Connections did not close if Request.Close or Response.Close was true. This meant that if the user wanted the connection to close, or if the server requested it via "Connection: close", the connection would not be closed.

Fixes #1967.

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

13 years agoA+C: add James Gray (Individual CLA)
Brad Fitzpatrick [Fri, 18 May 2012 17:32:54 +0000 (10:32 -0700)]
A+C: add James Gray (Individual CLA)

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

13 years agotls: add AES256 ciphers
Benjamin Black [Fri, 18 May 2012 15:06:58 +0000 (11:06 -0400)]
tls: add AES256 ciphers

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

13 years agoA+C: b@b3k.us
Adam Langley [Fri, 18 May 2012 15:04:32 +0000 (11:04 -0400)]
A+C: b@b3k.us

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

13 years agogo/build: fix some comments
Maxim Pimenov [Thu, 17 May 2012 18:19:19 +0000 (11:19 -0700)]
go/build: fix some comments

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

13 years agoexp/locale/collate: implementation of main collation functionality for
Marcel van Lohuizen [Thu, 17 May 2012 17:48:56 +0000 (19:48 +0200)]
exp/locale/collate: implementation of main collation functionality for
key and simple comparisson. Search is not yet implemented in this CL.
Changed some of the types of table_test.go to allow reuse in the new test.
Also reduced number of primary values for illegal runes to 1 (both map to
the same).

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

13 years ago api: undo go1.txt additions made by 27d0a516b7eb
Andrew Gerrand [Thu, 17 May 2012 08:08:28 +0000 (18:08 +1000)]
  api: undo go1.txt additions made by 27d0a516b7eb

We don't change go1.txt.

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

13 years agonet: avoid the Mac firewall (again)
Russ Cox [Thu, 17 May 2012 06:01:03 +0000 (02:01 -0400)]
net: avoid the Mac firewall (again)

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

13 years agocmd/go: fix typo
Russ Cox [Thu, 17 May 2012 06:00:40 +0000 (02:00 -0400)]
cmd/go: fix typo

Fixes #3619.

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

13 years agoencoding/xml: fix decoding of unknown entities in non-strict mode
Gustavo Niemeyer [Thu, 17 May 2012 03:04:00 +0000 (00:04 -0300)]
encoding/xml: fix decoding of unknown entities in non-strict mode

Fixes #3447.

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

13 years agoencoding/xml: handle anonymous pointer fields
Gustavo Niemeyer [Thu, 17 May 2012 02:21:31 +0000 (23:21 -0300)]
encoding/xml: handle anonymous pointer fields

This CL makes

    type T struct { *U }

behave in a similar way to:

    type T struct { U }

Fixes #3108.

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

13 years agoruntime: disable gc test on non-amd64 systems
Andrew Gerrand [Thu, 17 May 2012 01:34:28 +0000 (11:34 +1000)]
runtime: disable gc test on non-amd64 systems

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

13 years agopkg/runtime: Fix semasleep on Plan 9
Akshat Kumar [Wed, 16 May 2012 22:09:28 +0000 (15:09 -0700)]
pkg/runtime: Fix semasleep on Plan 9

With the timed semacquire patch
(kernel-tsemacquire) for Plan 9,
we can now properly do a timed
wait for the semaphore, in
semasleep.

R=golang-dev, rsc, rminnich, ality, r
CC=0intro, golang-dev, john, mirtchovski
https://golang.org/cl/6197046

13 years agomisc/chrome/gophertool: lower CL number's lower bound and fix input focus on Mac
Shenghou Ma [Wed, 16 May 2012 20:22:44 +0000 (04:22 +0800)]
misc/chrome/gophertool: lower CL number's lower bound and fix input focus on Mac
As our CL number could be as small as 152046, changed CL number's lower bound
to 150000. Hopefully our issue count won't reach 150000 any time soon.
Chrome on Mac OS X has very strange behavior regarding the focus, although we
force the focus to the input box on load, the page still come up with focus on
"issue". Set the tabindex of the input box as a workaround.

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

13 years agocmd/5c: re-enable regopt()
Shenghou Ma [Wed, 16 May 2012 18:58:14 +0000 (02:58 +0800)]
cmd/5c: re-enable regopt()
        After CL 6185047, ./all.bash passed.

benchmark                       old ns/op    new ns/op    delta
BenchmarkAppend                      5558         4894  -11.95%
BenchmarkAppendSpecialCase           5242         4572  -12.78%
BenchmarkSelectUncontended           3719         2821  -24.15%
BenchmarkSelectContended             3776         2832  -25.00%
BenchmarkSelectNonblock              1030         1089   +5.73%
BenchmarkChanUncontended              530          422  -20.38%
BenchmarkChanContended                534          444  -16.85%
BenchmarkChanSync                    1613         1492   -7.50%
BenchmarkChanProdCons0               1520         1351  -11.12%
BenchmarkChanProdCons10               785          668  -14.90%
BenchmarkChanProdCons100              564          473  -16.13%
BenchmarkChanProdConsWork0          11205        10337   -7.75%
BenchmarkChanProdConsWork10          9806         9567   -2.44%
BenchmarkChanProdConsWork100         9413         9398   -0.16%
BenchmarkChanCreation               11687         8715  -25.43%
BenchmarkChanSem                      553          453  -18.08%
BenchmarkCallClosure                   22           22   +0.44%
BenchmarkCallClosure1                  28           28   +0.71%
BenchmarkCallClosure2                2224         1668  -25.00%
BenchmarkCallClosure3                2217         1629  -26.52%
BenchmarkCallClosure4                2240         1684  -24.82%
BenchmarkComplex128DivNormal          930          912   -1.94%
BenchmarkComplex128DivNisNaN          862          866   +0.46%
BenchmarkComplex128DivDisNaN          849          852   +0.35%
BenchmarkComplex128DivNisInf          556          583   +4.86%
BenchmarkComplex128DivDisInf          522          512   -1.92%
BenchmarkConvT2E                      175          159   -9.14%
BenchmarkConvT2EBig                  2418         1823  -24.61%
BenchmarkConvT2I                      545          549   +0.73%
BenchmarkConvI2E                       35           32   -9.58%
BenchmarkConvI2I                      404          391   -3.22%
BenchmarkAssertE2T                     75           62  -16.25%
BenchmarkAssertE2TBig                  76           63  -16.80%
BenchmarkAssertE2I                    427          409   -4.22%
BenchmarkAssertI2T                     82           66  -20.29%
BenchmarkAssertI2I                    430          416   -3.26%
BenchmarkAssertI2E                     36           32  -12.50%
BenchmarkAssertE2E                     35           35   +0.57%
BenchmarkFinalizer                   3224         2941   -8.78%
BenchmarkFinalizerRun              117392        84772  -27.79%
BenchmarkStackGrowth                 5267         5930  +12.59%
BenchmarkSyscall                      191          167  -12.57%
BenchmarkSyscallWork                 9918         7713  -22.23%
BenchmarkIfaceCmp100                 1645         1652   +0.43%
BenchmarkIfaceCmpNil100              1433         1440   +0.49%

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

13 years agocodereview: support mercurial 2.2.1
Shenghou Ma [Wed, 16 May 2012 18:54:03 +0000 (02:54 +0800)]
codereview: support mercurial 2.2.1
        We explicitly use plainformatter to avoid the
        user's debug setting changing our behavior.
        Fixes #3603.

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

13 years agolog: fix typo in comment
Benny Siegert [Wed, 16 May 2012 12:56:18 +0000 (22:56 +1000)]
log: fix typo in comment

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

13 years agodoc/install: document minimum system requirements
Shenghou Ma [Wed, 16 May 2012 04:54:48 +0000 (14:54 +1000)]
doc/install: document minimum system requirements
        Partly copied from CL 5685076.

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

13 years agotest: add bug439, valid code that caused a gccgo crash
Ian Lance Taylor [Tue, 15 May 2012 20:29:46 +0000 (13:29 -0700)]
test: add bug439, valid code that caused a gccgo crash

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

13 years agogo/printer: don't print newlines for empty statements
Robert Griesemer [Tue, 15 May 2012 19:21:21 +0000 (12:21 -0700)]
go/printer: don't print newlines for empty statements

Fixes #3466.

gofmt -w src misc causes no changes.

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

13 years agoruntime: implement getcontext and sigprocmask for netbsd
Joel Sing [Tue, 15 May 2012 18:32:49 +0000 (04:32 +1000)]
runtime: implement getcontext and sigprocmask for netbsd

Implement getcontext and sigprocmask for NetBSD - these will soon be
used by the thread handling code.

Also fix netbsd/386 signal handling - there is no sigreturn, just
return so that we hit the trampoline.

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

13 years agoruntime: fix netbsd syscalls
Joel Sing [Tue, 15 May 2012 17:33:37 +0000 (03:33 +1000)]
runtime: fix netbsd syscalls

Use correct system calls/syscall numbers for NetBSD.

R=golang-dev, for.go.yong, rsc
CC=golang-dev
https://golang.org/cl/6200070

13 years agocmd/go: invoke godoc with import path when possible
Russ Cox [Tue, 15 May 2012 16:53:57 +0000 (12:53 -0400)]
cmd/go: invoke godoc with import path when possible
Also add -n -x flags to doc, fmt, vet.
Also shorten unknown command error.

Fixes #3612.
Fixes #3613.

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

13 years ago8l,5l: 2% faster
Jan Ziak [Tue, 15 May 2012 16:52:18 +0000 (12:52 -0400)]
8l,5l: 2% faster

R=golang-dev, for.go.yong
CC=golang-dev
https://golang.org/cl/6197080

13 years agocmd/gc: make append(nil, x) error more precise
Russ Cox [Tue, 15 May 2012 16:51:58 +0000 (12:51 -0400)]
cmd/gc: make append(nil, x) error more precise

Before:
./x.go:6: first argument to append must be slice; have nil

After:
./x.go:6: first argument to append must be typed slice; have untyped nil

Fixes #3616.

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

13 years agoruntime: fix netbsd signal handling
Joel Sing [Tue, 15 May 2012 15:53:26 +0000 (01:53 +1000)]
runtime: fix netbsd signal handling

Update/correct NetBSD signal handling - most of this is needed due to
the correctly generated runtime definitions.

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

13 years agoruntime: fix netbsd runtime defs
Joel Sing [Tue, 15 May 2012 15:52:20 +0000 (01:52 +1000)]
runtime: fix netbsd runtime defs

Fix and regenerate runtime defs for NetBSD.

Whilst the mcontext struct can be handled across architectures,
the registers are provided as defines that index an array, rather
than as members of the struct. Since these are architecture
dependent, include them via a defs_netbsd_<arch>.go file.

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

13 years agoruntime: fix counting of free objects
Jan Ziak [Tue, 15 May 2012 15:48:58 +0000 (11:48 -0400)]
runtime: fix counting of free objects

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

13 years agoruntime: refactor helpgc functionality in preparation for parallel GC
Dmitriy Vyukov [Tue, 15 May 2012 15:10:16 +0000 (19:10 +0400)]
runtime: refactor helpgc functionality in preparation for parallel GC
Parallel GC needs to know in advance how many helper threads will be there.
Hopefully it's the last patch before I can tackle parallel sweep phase.
The benchmarks are unaffected.

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

13 years agoos/syscall: correct netbsd types/names
Joel Sing [Tue, 15 May 2012 02:00:13 +0000 (12:00 +1000)]
os/syscall: correct netbsd types/names

Fix types/names so that these functions work with the generated
syscall/z* files.

R=golang-dev, m4dh4tt3r
CC=golang-dev
https://golang.org/cl/6201078

13 years agoruntime: fix TLS handling for netbsd
Joel Sing [Tue, 15 May 2012 01:26:05 +0000 (11:26 +1000)]
runtime: fix TLS handling for netbsd

Set the TLS base using the _lwp_setprivate() syscall, instead of via
sysarch(). NetBSD tracks the pointer passed to _lwp_setprivate() and
restores this value when restoring mcontext. If sysarch() is used
directly, restoring an mcontext trashes the FS/GS value, resulting
in a segfault when we next try to access the TLS.

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

13 years agomime/multipart: fix handling of empty parts without CRLF before next part
Brad Fitzpatrick [Tue, 15 May 2012 01:16:47 +0000 (18:16 -0700)]
mime/multipart: fix handling of empty parts without CRLF before next part

Empty parts can be either of the form:

a) "--separator\r\n", header (w/ trailing 2xCRLF), \r\n "--separator"...
or
b) "--separator\r\n", header (w/ trailing 2xCRLF), "--separator"...

We never handled case b).  In fact the RFC seems kinda vague about
it, but browsers seem to do a), and App Engine's synthetic POST
bodies after blob uploads is of form b).

So handle them both, and add a bunch of tests.

(I can't promise these are the last fixes to multipart, especially
considering its history, but I'm growing increasingly confident at
least, and I've never submitted a multipart CL with known bugs
outstanding, including this time.)

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

13 years agomisc/dashboard/codereview: add sameer.
David Symonds [Mon, 14 May 2012 22:38:05 +0000 (08:38 +1000)]
misc/dashboard/codereview: add sameer.

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

13 years agoregexp/syntax: replace internal error on unexpected ) w/ ErrUnexpectedParen
Jan Mercl [Mon, 14 May 2012 18:50:25 +0000 (11:50 -0700)]
regexp/syntax: replace internal error on unexpected ) w/ ErrUnexpectedParen

Unbalanced extra right parenthesis produced an internal error instead of
a more descriptive one.

Fixes #3406.

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

13 years agosyscall: regenerate z* files for netbsd
Joel Sing [Mon, 14 May 2012 17:40:13 +0000 (10:40 -0700)]
syscall: regenerate z* files for netbsd

Fix mkerrors.sh so that it works on NetBSD.

Remove directory mode bits from types - this already appears in errors.

Regenerate the z* files now that cgo is working.

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

13 years agocrypto/tls: fix decoding of certLen in certificateMsg.unmarshal
Michael Gehring [Mon, 14 May 2012 16:26:29 +0000 (12:26 -0400)]
crypto/tls: fix decoding of certLen in certificateMsg.unmarshal

certLen was decoded incorrectly if length > 2^16-1.

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

13 years agoA+C: add Michael Gehring (individual CLA)
Adam Langley [Mon, 14 May 2012 15:28:55 +0000 (11:28 -0400)]
A+C: add Michael Gehring (individual CLA)

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

13 years agosync: use atomic.Store in Once.Do
Dmitriy Vyukov [Mon, 14 May 2012 15:27:29 +0000 (19:27 +0400)]
sync: use atomic.Store in Once.Do
No perf/semantic changes, merely improves code health.
There were several questions as to why Once.Do uses
atomic.CompareAndSwap to do a store.

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

13 years agomisc/dashboard/codereview: set In-Reply-To header to properly thread mail.
David Symonds [Mon, 14 May 2012 00:05:39 +0000 (10:05 +1000)]
misc/dashboard/codereview: set In-Reply-To header to properly thread mail.

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

13 years agoA+C: Jan Ziak (individual CLA)
David Symonds [Sun, 13 May 2012 11:20:39 +0000 (21:20 +1000)]
A+C: Jan Ziak (individual CLA)

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

13 years agoruntime: revert MaxGcproc from 16 to 4
Dmitriy Vyukov [Fri, 11 May 2012 09:30:34 +0000 (13:30 +0400)]
runtime: revert MaxGcproc from 16 to 4
The change accidentally come in with this revision:
https://code.google.com/p/go/source/detail?spec=svn345cbca96c5550f2e89bc727703301933802923c&r=14c38c23c819a17021b1808cf4a34ef3a1a17db5

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

13 years agoruntime: add parallel for algorithm
Dmitriy Vyukov [Fri, 11 May 2012 06:50:03 +0000 (10:50 +0400)]
runtime: add parallel for algorithm
This is factored out part of:
https://golang.org/cl/5279048/
(parallel GC)

R=bsiegert, mpimenov, rsc, minux.ma, r
CC=golang-dev
https://golang.org/cl/5986054

13 years agoruntime: fix complex division benchmarks
Shenghou Ma [Thu, 10 May 2012 19:09:14 +0000 (03:09 +0800)]
runtime: fix complex division benchmarks
we can't add the division result to n during iteration, because it might
turn n into NaN or Inf.

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

13 years agoruntime: fix syscalls for netbsd
Joel Sing [Thu, 10 May 2012 17:48:43 +0000 (03:48 +1000)]
runtime: fix syscalls for netbsd

Use correct syscall numbers and arguments for NetBSD.
Provide a trampoline for signal returns (using signal API 3).

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

13 years agoruntime: fix netbsd sigaction struct
Joel Sing [Thu, 10 May 2012 17:48:16 +0000 (03:48 +1000)]
runtime: fix netbsd sigaction struct

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

13 years agosyscall: repair netbsd z* files
Joel Sing [Thu, 10 May 2012 17:47:27 +0000 (03:47 +1000)]
syscall: repair netbsd z* files

Manually repair/update z* files for netbsd - this allows Go to
compile again on 386.

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

13 years agoexp/locale/collate: Add maketables tool and generated tables.
Marcel van Lohuizen [Wed, 9 May 2012 10:03:55 +0000 (12:03 +0200)]
exp/locale/collate: Add maketables tool and generated tables.
Also set maxContractLen automatically.
Note that the table size is much bigger than it needs to be.
Optimization is best done, though, when the language specific
tables are added.

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

13 years agocmd/go: fix remote help reference to "go help packages"
Francisco Souza [Wed, 9 May 2012 06:16:02 +0000 (16:16 +1000)]
cmd/go: fix remote help reference to "go help packages"

go help remote used to reference "go help importpath", which has
changed to "go help packages".

Fixes #3598.

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

13 years agogo: fix the import path "./..." not matching ".".
Nigel Tao [Wed, 9 May 2012 00:43:15 +0000 (10:43 +1000)]
go: fix the import path "./..." not matching ".".

Tested manually.

Fixes #3554.

Before:
$ cd $GOROOT/src/pkg
$ go list io
io
$ go list io/...
io
io/ioutil
$ cd $GOROOT/src/pkg/io
$ go list .
io
$ go list ./...
io/ioutil

After:
$ cd $GOROOT/src/pkg
$ go list io
io
$ go list io/...
io
io/ioutil
$ cd $GOROOT/src/pkg/io
$ go list .
io
$ go list ./...
io
io/ioutil
$ go list ././...
io
io/ioutil
$ go list ././.././io/...
io
io/ioutil
$ go list ../image
image
$ go list ../image/...
image
image/color
image/draw
image/gif
image/jpeg
image/png
$ go list ../.../template
html/template
text/template
$ cd $GOROOT/src/pkg
$ go list ./io
io
$ go list ./io/...
io
io/ioutil
$ go list ./.../pprof
net/http/pprof
runtime/pprof
$ go list ./compress
can't load package: package compress: no Go source files in /home/nigeltao/go/src/pkg/compress
$ go list ./compress/...
compress/bzip2
compress/flate
compress/gzip
compress/lzw
compress/zlib
$ cd $GOROOT/src/pkg/code.google.com
$ go list ./p/leveldb-go/...
code.google.com/p/leveldb-go/leveldb
code.google.com/p/leveldb-go/leveldb/crc
code.google.com/p/leveldb-go/leveldb/db
code.google.com/p/leveldb-go/leveldb/memdb
code.google.com/p/leveldb-go/leveldb/memfs
code.google.com/p/leveldb-go/leveldb/record
code.google.com/p/leveldb-go/leveldb/table
code.google.com/p/leveldb-go/manualtest/filelock
$ go list ./p/.../truetype
code.google.com/p/freetype-go/example/truetype
code.google.com/p/freetype-go/freetype/truetype
$ go list ./p/.../example
warning: "./p/.../example" matched no packages
$ go list ./p/.../example/...
code.google.com/p/freetype-go/example/freetype
code.google.com/p/freetype-go/example/gamma
code.google.com/p/freetype-go/example/raster
code.google.com/p/freetype-go/example/round
code.google.com/p/freetype-go/example/truetype
code.google.com/p/x-go-binding/example/imgview
code.google.com/p/x-go-binding/example/xgb

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

13 years agocompress/testdata: change {e,pi}.txt from 10k to 100k digits.
Nigel Tao [Wed, 9 May 2012 00:02:28 +0000 (10:02 +1000)]
compress/testdata: change {e,pi}.txt from 10k to 100k digits.

These files change from exactly 10003 bytes long to 100003: a digit,
a '.', 100k digits, and a '\n'.

The magic constants in compress/flate/deflate_test.go change since
deflateInflateStringTests checks that the compressed form of e.txt
is not 'too large'. I'm not exactly sure how these numbers were
originally calculated (they were introduced in codereview 5554066
"make lazy matching work"); perhaps krasin@golang.org can comment.
My change was to increase the first one (no compression) to a tight
bound, and multiply all the others by 10.

Benchcmp numbers for compress/flate and compress/lzw below. LZW's
window size of 4096 is less than 10k, so shows no significant change.
Flate's window size is 32768, between 10k and 100k, and so the .*1e5
and .*1e6 benchmarks show a dramatic drop, since the compressed forms
are no longer a trivial forward copy of 10k digits repeated over and
over, but should now be more representative of real world usage.

compress/flate:
benchmark                            old MB/s     new MB/s  speedup
BenchmarkDecodeDigitsSpeed1e4           16.58        16.52    1.00x
BenchmarkDecodeDigitsSpeed1e5           68.09        18.10    0.27x
BenchmarkDecodeDigitsSpeed1e6          124.63        18.35    0.15x
BenchmarkDecodeDigitsDefault1e4         17.21        17.12    0.99x
BenchmarkDecodeDigitsDefault1e5        118.28        19.19    0.16x
BenchmarkDecodeDigitsDefault1e6        295.62        20.52    0.07x
BenchmarkDecodeDigitsCompress1e4        17.22        17.17    1.00x
BenchmarkDecodeDigitsCompress1e5       118.19        19.21    0.16x
BenchmarkDecodeDigitsCompress1e6       295.59        20.55    0.07x
BenchmarkEncodeDigitsSpeed1e4            8.18         8.19    1.00x
BenchmarkEncodeDigitsSpeed1e5           43.22        12.84    0.30x
BenchmarkEncodeDigitsSpeed1e6           80.76        13.48    0.17x
BenchmarkEncodeDigitsDefault1e4          6.29         6.19    0.98x
BenchmarkEncodeDigitsDefault1e5         31.63         3.60    0.11x
BenchmarkEncodeDigitsDefault1e6         52.97         3.24    0.06x
BenchmarkEncodeDigitsCompress1e4         6.20         6.19    1.00x
BenchmarkEncodeDigitsCompress1e5        31.59         3.59    0.11x
BenchmarkEncodeDigitsCompress1e6        53.18         3.25    0.06x

compress/lzw:
benchmark               old MB/s     new MB/s  speedup
BenchmarkDecoder1e4        21.99        22.09    1.00x
BenchmarkDecoder1e5        22.77        22.71    1.00x
BenchmarkDecoder1e6        22.90        22.90    1.00x
BenchmarkEncoder1e4        21.04        21.19    1.01x
BenchmarkEncoder1e5        22.06        22.06    1.00x
BenchmarkEncoder1e6        22.16        22.28    1.01x

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

13 years agocompress/flate: benchmark some English text, not just the digits of e.
Nigel Tao [Tue, 8 May 2012 22:57:54 +0000 (08:57 +1000)]
compress/flate: benchmark some English text, not just the digits of e.

The testdata/e.txt input is repeated on the longer benchmarks, but the
length of that data is less than flate's window size, so the numbers are
essentially measuring the performance of a trivial compression. A follow-up
CL will add more data to testdata/e.txt.

Sample output on my laptop (linux, amd64):

BenchmarkDecodeDigitsSpeed1e4     5000     603153 ns/op   16.58 MB/s
BenchmarkDecodeDigitsSpeed1e5     1000    1465602 ns/op   68.23 MB/s
BenchmarkDecodeDigitsSpeed1e6      200    8036050 ns/op  124.44 MB/s
BenchmarkDecodeDigitsDefault1e4     5000     581796 ns/op   17.19 MB/s
BenchmarkDecodeDigitsDefault1e5     2000     846653 ns/op  118.11 MB/s
BenchmarkDecodeDigitsDefault1e6      500    3385782 ns/op  295.35 MB/s
BenchmarkDecodeDigitsCompress1e4     5000     581180 ns/op   17.21 MB/s
BenchmarkDecodeDigitsCompress1e5     2000     846209 ns/op  118.17 MB/s
BenchmarkDecodeDigitsCompress1e6      500    3386174 ns/op  295.32 MB/s
BenchmarkDecodeTwainSpeed1e4     5000     643563 ns/op   15.54 MB/s
BenchmarkDecodeTwainSpeed1e5      500    5418408 ns/op   18.46 MB/s
BenchmarkDecodeTwainSpeed1e6       50   52277520 ns/op   19.13 MB/s
BenchmarkDecodeTwainDefault1e4     5000     583551 ns/op   17.14 MB/s
BenchmarkDecodeTwainDefault1e5      500    4443428 ns/op   22.51 MB/s
BenchmarkDecodeTwainDefault1e6       50   41862080 ns/op   23.89 MB/s
BenchmarkDecodeTwainCompress1e4     5000     583490 ns/op   17.14 MB/s
BenchmarkDecodeTwainCompress1e5      500    4426356 ns/op   22.59 MB/s
BenchmarkDecodeTwainCompress1e6       50   41657940 ns/op   24.01 MB/s
BenchmarkEncodeDigitsSpeed1e4     2000    1230907 ns/op    8.12 MB/s
BenchmarkEncodeDigitsSpeed1e5     1000    2319129 ns/op   43.12 MB/s
BenchmarkEncodeDigitsSpeed1e6      100   12378950 ns/op   80.78 MB/s
BenchmarkEncodeDigitsDefault1e4     1000    1597865 ns/op    6.26 MB/s
BenchmarkEncodeDigitsDefault1e5      500    3163458 ns/op   31.61 MB/s
BenchmarkEncodeDigitsDefault1e6      100   18770240 ns/op   53.28 MB/s
BenchmarkEncodeDigitsCompress1e4     1000    1603461 ns/op    6.24 MB/s
BenchmarkEncodeDigitsCompress1e5      500    3168766 ns/op   31.56 MB/s
BenchmarkEncodeDigitsCompress1e6      100   18855830 ns/op   53.03 MB/s
BenchmarkEncodeTwainSpeed1e4     1000    1338049 ns/op    7.47 MB/s
BenchmarkEncodeTwainSpeed1e5      500    7341622 ns/op   13.62 MB/s
BenchmarkEncodeTwainSpeed1e6       50   67484600 ns/op   14.82 MB/s
BenchmarkEncodeTwainDefault1e4     1000    1778399 ns/op    5.62 MB/s
BenchmarkEncodeTwainDefault1e5      100   23261810 ns/op    4.30 MB/s
BenchmarkEncodeTwainDefault1e6       10  243533600 ns/op    4.11 MB/s
BenchmarkEncodeTwainCompress1e4     1000    1795469 ns/op    5.57 MB/s
BenchmarkEncodeTwainCompress1e5       50   29447140 ns/op    3.40 MB/s
BenchmarkEncodeTwainCompress1e6        5  321686800 ns/op    3.11 MB/s
ok   compress/flate 89.246s

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

13 years agocompress/testdata: remove Byte Order Mark from the Tom Sawyer data.
Nigel Tao [Tue, 8 May 2012 00:41:45 +0000 (10:41 +1000)]
compress/testdata: remove Byte Order Mark from the Tom Sawyer data.

I'm not sure where the BOM came from, originally.
http://www.gutenberg.org/files/74/74.txt doesn't have it, although
a fresh download of that URL gives me "\r\n"s instead of plain "\n"s,
and the extra line "Character set encoding: ASCII". Maybe Project
Gutenberg has changed their server configuration since we added that
file to the Go repo.

Anyway, this change is just manually excising the BOM from the start
of the file, leaving pure ASCII.

R=r, bradfitz
CC=golang-dev, krasin, rsc
https://golang.org/cl/6197061

13 years agocrypto/aes: fix comment
Russ Cox [Mon, 7 May 2012 20:45:34 +0000 (16:45 -0400)]
crypto/aes: fix comment

Fixes #3589.

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

13 years agotest/bench/shootout: fix gccgo binary-list-freelist test
Ian Lance Taylor [Mon, 7 May 2012 17:14:50 +0000 (10:14 -0700)]
test/bench/shootout: fix gccgo binary-list-freelist test

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

13 years agomisc/emacs: Restore the window position after a successful gofmt.
Jean-Marc Eurin [Mon, 7 May 2012 15:46:01 +0000 (11:46 -0400)]
misc/emacs: Restore the window position after a successful gofmt.

This adds restoring the window position so that the buffer doesn't jump around after the erase/copy.

R=sameer
CC=golang-dev
https://golang.org/cl/5981055

13 years agoC: correct entry: jmeurin, not jme.
Sameer Ajmani [Mon, 7 May 2012 15:40:43 +0000 (11:40 -0400)]
C: correct entry: jmeurin, not jme.

R=golang-dev, rsc
CC=golang-dev, jme, jmeurin
https://golang.org/cl/6192057

13 years agoC: Jeremy Ellington (Google CLA)
Sameer Ajmani [Mon, 7 May 2012 14:47:58 +0000 (10:47 -0400)]
C: Jeremy Ellington (Google CLA)

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

13 years agoexp/locale/collate: from the regression test we derive that the spec
Marcel van Lohuizen [Mon, 7 May 2012 09:51:40 +0000 (11:51 +0200)]
exp/locale/collate: from the regression test we derive that the spec
dictates a CJK rune is only part of a certain specified range if it
is explicitly defined in the Unicode Codepoint Database.
Fixed the code and some of the tests accordingly.

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

13 years agoexp/norm: It is important that the unicode versions of the various packages align.
Marcel van Lohuizen [Mon, 7 May 2012 09:41:40 +0000 (11:41 +0200)]
exp/norm: It is important that the unicode versions of the various packages align.
Replace hard-coded version strings with unicode.Version.

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

13 years agotest: add bug438, a valid test case that gccgo used to fail to compile
Ian Lance Taylor [Fri, 4 May 2012 20:14:09 +0000 (13:14 -0700)]
test: add bug438, a valid test case that gccgo used to fail to compile

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

13 years agosync/atomic: fix 64-bit atomic cas for Linux/ARM
Shenghou Ma [Fri, 4 May 2012 18:02:36 +0000 (02:02 +0800)]
sync/atomic: fix 64-bit atomic cas for Linux/ARM
    This is a follow-up to CL 5978051.
    Use kernel cas64 helper if we can, fallback to LDREXD/STREXD if
    we are on ARMv6 or higher, and to lock-emulated cas64 if on ARMv5.
    A future CL will fix {Add,Load,Store}{Int,Uint}64 and issue 3331.

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

13 years agoruntime: get per-process random number from auxv for hash table
Shenghou Ma [Fri, 4 May 2012 17:59:14 +0000 (01:59 +0800)]
runtime: get per-process random number from auxv for hash table
Decode AT_RANDOM, AT_HWCAP, and AT_PLATFORM.
This CL only make use of AT_RANDOM, but future CLs will make use of the others.

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

13 years agocmd/cgo, cmd/cc, cmd/ld: detect dynamic linker automatically
Shenghou Ma [Fri, 4 May 2012 17:54:16 +0000 (01:54 +0800)]
cmd/cgo, cmd/cc, cmd/ld: detect dynamic linker automatically
Some newer Linux distributions (Ubuntu ARM at least) use a new multiarch
directory organization, where dynamic linker is no longer in the hardcoded
path in our linker.
For example, Ubuntu 12.04 ARM hardfloat places its dynamic linker at
/lib/arm-linux-gnueabihf/ld-linux.so.3

Ref: http://lackof.org/taggart/hacking/multiarch/

Also, to support Debian GNU/kFreeBSD as a FreeBSD variant, we need this capability, so it's part of issue 3533.

This CL add a new pragma (#pragma dynlinker "path") to cc.

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

13 years agoruntime: fix c compiler warning
Shenghou Ma [Fri, 4 May 2012 17:39:09 +0000 (01:39 +0800)]
runtime: fix c compiler warning

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

13 years agoruntime, misc/cgo/test: fix build for Linux/ARM
Shenghou Ma [Fri, 4 May 2012 17:35:13 +0000 (01:35 +0800)]
runtime, misc/cgo/test: fix build for Linux/ARM
1. In CL 5989057, I made a mistake in the last minute change.
"MOVW.W R4, -4(SP)" should really be "MOVW.W R4, -4(R13)",
as 5l will rewrite offset for SP.
2. misc/cgo/test/issue1560.go tests for parallel sleep of 1s,
but on ARM, the deadline is frequently missed, so change sleep
time to 2s on ARM.

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

13 years agomath/big: fix superpolynomial complexity in Karatsuba algorithm.
Rémy Oudompheng [Fri, 4 May 2012 17:05:26 +0000 (19:05 +0200)]
math/big: fix superpolynomial complexity in Karatsuba algorithm.

benchmark                     old ns/op    new ns/op    delta
BenchmarkExp3Power0x10              732          734   +0.27%
BenchmarkExp3Power0x40              834          836   +0.24%
BenchmarkExp3Power0x100            1600         1579   -1.31%
BenchmarkExp3Power0x400            3478         3417   -1.75%
BenchmarkExp3Power0x1000          19388        19229   -0.82%
BenchmarkExp3Power0x4000         160274       156881   -2.12%
BenchmarkExp3Power0x10000       1552050      1372058  -11.60%
BenchmarkExp3Power0x40000      27328710     15216920  -44.32%
BenchmarkExp3Power0x100000    612349000    131407100  -78.54%
BenchmarkExp3Power0x400000  44073524000   1122195000  -97.45%

R=golang-dev, mtj, gri, rsc
CC=golang-dev, remy
https://golang.org/cl/6176043