]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agotiming.log: significant improvements after custom algorithms
Rob Pike [Wed, 10 Aug 2011 05:45:37 +0000 (15:45 +1000)]
timing.log: significant improvements after custom algorithms
See https://golang.org/cl/4815087

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

13 years agohtml: parse malformed tags missing a '>', such as `<p id=0</p>`.
Nigel Tao [Wed, 10 Aug 2011 03:39:07 +0000 (13:39 +1000)]
html: parse malformed tags missing a '>', such as `<p id=0</p>`.

The additional token_test.go cases matches html5lib behavior.

Fixes #2124.

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

13 years agold: add one empty symbol into pe to make dumpbin works.
Wei Guangjing [Wed, 10 Aug 2011 01:09:06 +0000 (11:09 +1000)]
ld: add one empty symbol into pe to make dumpbin works.

Fixes #2139.

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

13 years agohttp: configurable and default request header size limit
Brad Fitzpatrick [Tue, 9 Aug 2011 17:55:14 +0000 (10:55 -0700)]
http: configurable and default request header size limit

This addresses the biggest DoS in issue 2093

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

13 years agohttp: add test to serve content in index.html
Yasuhiro Matsumoto [Tue, 9 Aug 2011 17:25:53 +0000 (10:25 -0700)]
http: add test to serve content in index.html

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

13 years agoexp/template: do not take address of interface variable to find methods.
Rob Pike [Tue, 9 Aug 2011 07:07:29 +0000 (17:07 +1000)]
exp/template: do not take address of interface variable to find methods.
Also allow struct values as "with" targets.

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

13 years agoexp/template: remove reflect from the API
Rob Pike [Tue, 9 Aug 2011 06:49:36 +0000 (16:49 +1000)]
exp/template: remove reflect from the API
It means keeping two sets of maps, but things look cleaner from
the outside.

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

13 years agoexp/template: split the parse tree into a separate package exp/template/parse
Rob Pike [Tue, 9 Aug 2011 05:42:53 +0000 (15:42 +1000)]
exp/template: split the parse tree into a separate package exp/template/parse

Mostly a mechanical change, with a few cleanups to make the split easier.
The external interface to exp/template is unaffected.

In another round I will play with the function map setup to see if I can
avoid exposing reflect across the boundary, but that will require some
structural changes I did not want to mix into this CL.

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

13 years agocrypto/x509, go/scanner, index/suffixarray: Removed []interface{}/vector uses.
Kyle Consalus [Mon, 8 Aug 2011 21:32:37 +0000 (14:32 -0700)]
crypto/x509, go/scanner, index/suffixarray: Removed []interface{}/vector uses.

Changed some []interface{} uses to slices of the concrete types; removed use of IntVector.

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

13 years agoscanner: correct error position for illegal UTF-8 encodings
Robert Griesemer [Mon, 8 Aug 2011 20:54:32 +0000 (13:54 -0700)]
scanner: correct error position for illegal UTF-8 encodings

- added corresponding test cases
- re-grouped tests for better readability

Fixes #2138.

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

13 years agocontainer/vector: removed last instances of vector outside of container/vector itself...
John Asmuth [Mon, 8 Aug 2011 18:27:09 +0000 (11:27 -0700)]
container/vector: removed last instances of vector outside of container/vector itself from the core libs

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

13 years agosyscall: move bsd mmap syscall
Joel Sing [Mon, 8 Aug 2011 13:56:45 +0000 (09:56 -0400)]
syscall: move bsd mmap syscall

The mmap system call varies across BSDs. Move mmap and munmap into
the operating system dependent files. This will be needed to add
syscall support for OpenBSD.

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

13 years agonet: add support for openbsd
Joel Sing [Mon, 8 Aug 2011 13:56:42 +0000 (09:56 -0400)]
net: add support for openbsd

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

13 years agoruntime: openbsd amd64 runtime support
Joel Sing [Mon, 8 Aug 2011 13:56:38 +0000 (09:56 -0400)]
runtime: openbsd amd64 runtime support

Add support for the go runtime on openbsd/amd64. This is based on
the existing freebsd runtime.

Threads are implemented using OpenBSD's rthreads, which are currently
disabled by default, however can be enabled via the kern.rthreads
sysctl.

For now, cgo is disabled.

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

13 years agoos: add support for openbsd
Joel Sing [Mon, 8 Aug 2011 13:56:36 +0000 (09:56 -0400)]
os: add support for openbsd

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

13 years agoexp/template: document that comments may span newlines.
Rob Pike [Mon, 8 Aug 2011 13:42:49 +0000 (23:42 +1000)]
exp/template: document that comments may span newlines.

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

13 years agoruntime: add more specialized type algorithms
Dmitriy Vyukov [Mon, 8 Aug 2011 13:35:32 +0000 (09:35 -0400)]
runtime: add more specialized type algorithms
The change adds specialized type algorithms
for slices and types of size 8/16/32/64/128.
It significantly accelerates chan and map operations
for most builtin types as well as user structs.

benchmark                   old,ns/op   new,ns/op
BenchmarkChanUncontended          226          94
(on Intel Xeon E5620, 2.4GHz, Linux 64 bit)

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

13 years agoexp/template: url filter.
David Symonds [Mon, 8 Aug 2011 06:29:57 +0000 (16:29 +1000)]
exp/template: url filter.

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

13 years agoexp/template: fix Must example.
David Symonds [Mon, 8 Aug 2011 05:38:37 +0000 (15:38 +1000)]
exp/template: fix Must example.

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

13 years agotime: parse and format fractional seconds
Rob Pike [Sun, 7 Aug 2011 21:50:17 +0000 (07:50 +1000)]
time: parse and format fractional seconds

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

13 years agogofmt: update test script so 'make test' succeeds
Robert Griesemer [Sat, 6 Aug 2011 19:30:54 +0000 (12:30 -0700)]
gofmt: update test script so 'make test' succeeds

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

13 years agoFAQ: variant types, unions
Rob Pike [Sat, 6 Aug 2011 01:21:59 +0000 (11:21 +1000)]
FAQ: variant types, unions
Fixes #1935.

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

13 years agoFAQ: lots of small tweaks plus a couple of new discussions.
Rob Pike [Fri, 5 Aug 2011 21:41:55 +0000 (07:41 +1000)]
FAQ: lots of small tweaks plus a couple of new discussions.
Expand the conversations about pointers, memory, and
garbage collection.
Describe the lack of co/contravariant typing.

Fixes #1929.
Fixes #1930.

R=dsymonds, r, mirtchovski, edsrzf, hanwen, rsc
CC=golang-dev
https://golang.org/cl/4852041

13 years agotime: fix windows build
Alex Brainman [Fri, 5 Aug 2011 07:19:17 +0000 (17:19 +1000)]
time: fix windows build

R=golang-dev, mattn.jp, dsymonds
CC=golang-dev
https://golang.org/cl/4849042

13 years agoasn1: fix build
Rob Pike [Fri, 5 Aug 2011 05:10:06 +0000 (15:10 +1000)]
asn1: fix build

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

13 years agotime: add nanoseconds to the Time structure.
Rob Pike [Fri, 5 Aug 2011 03:44:02 +0000 (13:44 +1000)]
time: add nanoseconds to the Time structure.

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

13 years agonet: implement windows LookupMX and LookupAddr
Alex Brainman [Fri, 5 Aug 2011 00:27:51 +0000 (10:27 +1000)]
net: implement windows LookupMX and LookupAddr

Also sort SRV records before returning from LookupSRV.

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

13 years agonet: fix /proc/net/igmp,igmp6 reading bug on linux
Mikio Hara [Thu, 4 Aug 2011 23:20:13 +0000 (09:20 +1000)]
net: fix /proc/net/igmp,igmp6 reading bug on linux

Fixes #2130.

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

13 years agoexp/norm: fix build by adding a test placeholder
Rob Pike [Thu, 4 Aug 2011 22:25:49 +0000 (08:25 +1000)]
exp/norm: fix build by adding a test placeholder

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

13 years agoexp/norm: maketables tool for generating tables for normalization.
Marcel van Lohuizen [Thu, 4 Aug 2011 21:15:19 +0000 (23:15 +0200)]
exp/norm: maketables tool for generating tables for normalization.

R=r, bsiegert, r, alex.brainman
CC=golang-dev
https://golang.org/cl/4662080

13 years agoruntime: faster chan creation on Linux/FreeBSD/Plan9
Dmitriy Vyukov [Thu, 4 Aug 2011 12:31:03 +0000 (08:31 -0400)]
runtime: faster chan creation on Linux/FreeBSD/Plan9
The change removes chan finalizer (Lock destructor)
if it is not required on the platform.

benchmark                    old ns/op    new ns/op    delta
BenchmarkChanCreation          1132.00       381.00  -66.34%
BenchmarkChanCreation-2        1215.00       243.00  -80.00%
BenchmarkChanCreation-4        1084.00       186.00  -82.84%
BenchmarkChanCreation-8        1415.00       154.00  -89.12%
BenchmarkChanCreation-16       1386.00       144.00  -89.61%
(on 2 x Intel Xeon E5620, 8 HT cores, 2.4 GHz, Linux)

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

13 years agohttp: correct path to serve index.html.
Yasuhiro Matsumoto [Thu, 4 Aug 2011 12:20:53 +0000 (08:20 -0400)]
http: correct path to serve index.html.
calling filepath.FromSlash(x) make invalid character to serve file.
Fixes #2128

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

13 years agohttp: add more MPEG-4 MIME types to sniffer, and disable MP4 sniffing.
David Symonds [Thu, 4 Aug 2011 12:10:17 +0000 (22:10 +1000)]
http: add more MPEG-4 MIME types to sniffer, and disable MP4 sniffing.

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

13 years agofmt: call UpdateMemStats in malloc counter
Rob Pike [Thu, 4 Aug 2011 06:32:14 +0000 (16:32 +1000)]
fmt: call UpdateMemStats in malloc counter

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

13 years agogob: avoid a couple of init-time allocations.
David Symonds [Thu, 4 Aug 2011 06:22:22 +0000 (16:22 +1000)]
gob: avoid a couple of init-time allocations.

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

13 years agogob: add UpdateMemStats calls to malloc counter
Rob Pike [Thu, 4 Aug 2011 05:56:25 +0000 (15:56 +1000)]
gob: add UpdateMemStats calls to malloc counter

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

13 years agogob: don't invoke GobEncoder on zero values.
Rob Pike [Thu, 4 Aug 2011 04:39:44 +0000 (14:39 +1000)]
gob: don't invoke GobEncoder on zero values.

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

13 years agonet: joined group addresses for a specific interface for darwin, freebsd, linux
Mikio Hara [Thu, 4 Aug 2011 04:22:52 +0000 (00:22 -0400)]
net: joined group addresses for a specific interface for darwin, freebsd, linux

This CL enables to list the multicast, joined group addresses
for a specific interface by using Interface.MulticastAddrs
method.

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

13 years agosyscall: update routing message support for BSD variants
Mikio Hara [Thu, 4 Aug 2011 04:22:48 +0000 (00:22 -0400)]
syscall: update routing message support for BSD variants

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

13 years agoruntime: remove unnecessary locking
Hector Chu [Thu, 4 Aug 2011 04:22:39 +0000 (00:22 -0400)]
runtime: remove unnecessary locking

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

13 years agotest/bench: note changes after recent improvements to locking and runtime
Rob Pike [Thu, 4 Aug 2011 01:29:20 +0000 (11:29 +1000)]
test/bench: note changes after recent improvements to locking and runtime
Some tests are significantly faster (50%), a few are slower (up to 30%).
Fannkuch is confusing: parallel code is a little slower for gc, non-parallel and all gccgo runs are faster.

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

13 years agoruntime: correct Note documentation
Dmitriy Vyukov [Wed, 3 Aug 2011 19:51:55 +0000 (15:51 -0400)]
runtime: correct Note documentation
Reflect the fact that notesleep() can be called
by exactly one thread.

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

13 years agomisc/vim: Godoc command.
Yasuhiro Matsumoto [Wed, 3 Aug 2011 06:46:35 +0000 (16:46 +1000)]
misc/vim: Godoc command.
vim command 'Godoc' to see godoc.

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

13 years agoerrchk: add -0 flag
Russ Cox [Tue, 2 Aug 2011 19:19:44 +0000 (15:19 -0400)]
errchk: add -0 flag

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

13 years agold: fail linking if the top-level package is not main.
David Symonds [Tue, 2 Aug 2011 11:45:04 +0000 (07:45 -0400)]
ld: fail linking if the top-level package is not main.

This makes {5,6,8}l conform to the spec more tightly.

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

13 years agoexp/template: return nil value from helpers on error, even methods.
Rob Pike [Tue, 2 Aug 2011 03:02:52 +0000 (20:02 -0700)]
exp/template: return nil value from helpers on error, even methods.

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

13 years agogo/build: use GOBIN as binary path for GOROOT
Andrew Gerrand [Tue, 2 Aug 2011 02:17:23 +0000 (19:17 -0700)]
go/build: use GOBIN as binary path for GOROOT

Fixes #2106.

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

13 years agotag release.r59
Andrew Gerrand [Mon, 1 Aug 2011 21:20:02 +0000 (14:20 -0700)]
tag release.r59

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

13 years agoexp/template: make index function on maps return zero value when key not present.
Roger Peppe [Mon, 1 Aug 2011 16:03:35 +0000 (09:03 -0700)]
exp/template: make index function on maps return zero value when key not present.

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

13 years agoexp/template: ensure that a valid Set is returned even on error.
Roger Peppe [Mon, 1 Aug 2011 16:02:06 +0000 (09:02 -0700)]
exp/template: ensure that a valid Set is returned even on error.

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

13 years ago5g: fix set but not used error
Dave Cheney [Mon, 1 Aug 2011 02:54:47 +0000 (19:54 -0700)]
5g: fix set but not used error

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

13 years agohttp: correct format flags when printing errors during tests
Alex Brainman [Mon, 1 Aug 2011 01:50:50 +0000 (11:50 +1000)]
http: correct format flags when printing errors during tests

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

13 years agocmd/ld/pe.c: Corrected mismatched print formats and variables.
Lucio De Re [Mon, 1 Aug 2011 01:12:50 +0000 (11:12 +1000)]
cmd/ld/pe.c: Corrected mismatched print formats and variables.

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

13 years agohtml: parse doctype tokens; merge adjacent text nodes.
Nigel Tao [Mon, 1 Aug 2011 00:26:46 +0000 (10:26 +1000)]
html: parse doctype tokens; merge adjacent text nodes.

The test case input is "<!DOCTYPE html><span><button>foo</span>bar".
The correct parse is:
| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <span>
|       <button>
|         "foobar"

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

13 years agodoc: document release.r59
Andrew Gerrand [Sun, 31 Jul 2011 22:29:10 +0000 (15:29 -0700)]
doc: document release.r59

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

13 years agodoc: fix typo in Effective Go
Andrew Gerrand [Sun, 31 Jul 2011 22:25:26 +0000 (15:25 -0700)]
doc: fix typo in Effective Go

Fixes #2120.

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

13 years agosyscall: delay load of dll functions until they are called
Alex Brainman [Sun, 31 Jul 2011 10:07:04 +0000 (20:07 +1000)]
syscall: delay load of dll functions until they are called

Before this change, syscall package would load
all dlls used anywhere in the go tree on startup.
For example, this program:

package main

import "fmt"

func main() {
       fmt.Printf("Hello world\n")
}

would load these dlls

kernel32.dll
advapi32.dll
shell32.dll
wsock32.dll
ws2_32.dll
dnsapi.dll
iphlpapi.dll

Most of these dlls are network related and are not used
in this program. Now the same program loads only

kernel32.dll
shell32.dll

This decreases start times somewhat.

This also relaxes the rules of which dlls can be included
in the standard library. We could now include system calls
that are not available on all versions of Windows, because
we could decide if we should call them during runtime.

R=rsc, vcc.163
CC=golang-dev
https://golang.org/cl/4815046

13 years agogo_faq: drop a dramatic comma.
David Symonds [Sun, 31 Jul 2011 02:59:58 +0000 (12:59 +1000)]
go_faq: drop a dramatic comma.

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

13 years agoexp/norm: correct package doc comment
Andrew Gerrand [Sun, 31 Jul 2011 01:02:09 +0000 (18:02 -0700)]
exp/norm: correct package doc comment

Fixes #2118.

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

13 years agoexp/template: fix endless loop
Robert Griesemer [Sun, 31 Jul 2011 00:11:52 +0000 (17:11 -0700)]
exp/template: fix endless loop

No progress was made in indirect() if the reflect.Value
was an non-nil and non-empty interface.

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

13 years agotag weekly.2011-07-29
Andrew Gerrand [Fri, 29 Jul 2011 22:21:24 +0000 (15:21 -0700)]
tag weekly.2011-07-29

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

13 years agoweekly.2011-07-29 weekly.2011-07-29
Andrew Gerrand [Fri, 29 Jul 2011 22:11:48 +0000 (15:11 -0700)]
weekly.2011-07-29

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

13 years agoruntime: fix scheduling race
Hector Chu [Fri, 29 Jul 2011 21:39:02 +0000 (17:39 -0400)]
runtime: fix scheduling race

Affects programs using cgo or runtime.LockOSThread.

Fixes #2100.

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

13 years agoxml: Header: fix close tag and newline
Kyle Lemons [Fri, 29 Jul 2011 18:09:07 +0000 (14:09 -0400)]
xml: Header: fix close tag and newline

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

13 years agolibmach: stubs for openbsd
Joel Sing [Fri, 29 Jul 2011 17:48:00 +0000 (13:48 -0400)]
libmach: stubs for openbsd

Add libmach stubs for openbsd.

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

13 years agogodoc: allow form feed in text files
Russ Cox [Fri, 29 Jul 2011 17:47:54 +0000 (13:47 -0400)]
godoc: allow form feed in text files

Now recognizes misc/emacs/go-mode-load.el as text.

Fixes #2115.

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

13 years ago6l: OpenBSD support
Joel Sing [Fri, 29 Jul 2011 17:47:41 +0000 (13:47 -0400)]
6l: OpenBSD support

Add linker support for OpenBSD ELF-64.

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

13 years agoruntime: fix data race in findfunc()
Dmitriy Vyukov [Fri, 29 Jul 2011 17:47:24 +0000 (13:47 -0400)]
runtime: fix data race in findfunc()
The data race can lead to reads of partially
initialized concurrently mutated symbol data.
The change also adds a simple sanity test
for Caller() and FuncForPC().

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

13 years agosyscall: move bsd pipe syscall
Joel Sing [Fri, 29 Jul 2011 17:47:20 +0000 (13:47 -0400)]
syscall: move bsd pipe syscall

Not all BSDs have the same pipe() syscall implementation - move the Darwin/FreeBSD specific implementation into their respective OS syscall files. This will be needed to add OpenBSD syscall support.

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

13 years agoarchive/zip: more efficient reader and bug fix
Andrew Gerrand [Fri, 29 Jul 2011 17:47:00 +0000 (10:47 -0700)]
archive/zip: more efficient reader and bug fix

Fixes #2090.

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

13 years agoCONTRIBUTORS: add Joel Sing (Google CLA)
Russ Cox [Fri, 29 Jul 2011 17:31:42 +0000 (13:31 -0400)]
CONTRIBUTORS: add Joel Sing (Google CLA)

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

13 years agoruntime: improve Linux mutex
Dmitriy Vyukov [Fri, 29 Jul 2011 16:44:06 +0000 (12:44 -0400)]
runtime: improve Linux mutex
The implementation is hybrid active/passive spin/blocking mutex.
The design minimizes amount of context switches and futex calls.
The idea is that all critical sections in runtime are intentially
small, so pure blocking mutex behaves badly causing
a lot of context switches, thread parking/unparking and kernel calls.
Note that some synthetic benchmarks become somewhat slower,
that's due to increased contention on other data structures,
it should not affect programs that do any real work.

On 2 x Intel E5620, 8 HT cores, 2.4GHz
benchmark                     old ns/op    new ns/op    delta
BenchmarkSelectContended         521.00       503.00   -3.45%
BenchmarkSelectContended-2       661.00       320.00  -51.59%
BenchmarkSelectContended-4      1139.00       629.00  -44.78%
BenchmarkSelectContended-8      2870.00       878.00  -69.41%
BenchmarkSelectContended-16     5276.00       818.00  -84.50%
BenchmarkChanContended           112.00       103.00   -8.04%
BenchmarkChanContended-2         631.00       174.00  -72.42%
BenchmarkChanContended-4         682.00       272.00  -60.12%
BenchmarkChanContended-8        1601.00       520.00  -67.52%
BenchmarkChanContended-16       3100.00       372.00  -88.00%
BenchmarkChanSync                253.00       239.00   -5.53%
BenchmarkChanSync-2             5030.00      4648.00   -7.59%
BenchmarkChanSync-4             4826.00      4694.00   -2.74%
BenchmarkChanSync-8             4778.00      4713.00   -1.36%
BenchmarkChanSync-16            5289.00      4710.00  -10.95%
BenchmarkChanProdCons0           273.00       254.00   -6.96%
BenchmarkChanProdCons0-2         599.00       400.00  -33.22%
BenchmarkChanProdCons0-4        1168.00       659.00  -43.58%
BenchmarkChanProdCons0-8        2831.00      1057.00  -62.66%
BenchmarkChanProdCons0-16       4197.00      1037.00  -75.29%
BenchmarkChanProdCons10          150.00       140.00   -6.67%
BenchmarkChanProdCons10-2        607.00       268.00  -55.85%
BenchmarkChanProdCons10-4       1137.00       404.00  -64.47%
BenchmarkChanProdCons10-8       2115.00       828.00  -60.85%
BenchmarkChanProdCons10-16      4283.00       855.00  -80.04%
BenchmarkChanProdCons100         117.00       110.00   -5.98%
BenchmarkChanProdCons100-2       558.00       218.00  -60.93%
BenchmarkChanProdCons100-4       722.00       287.00  -60.25%
BenchmarkChanProdCons100-8      1840.00       431.00  -76.58%
BenchmarkChanProdCons100-16     3394.00       448.00  -86.80%
BenchmarkChanProdConsWork0      2014.00      1996.00   -0.89%
BenchmarkChanProdConsWork0-2    1207.00      1127.00   -6.63%
BenchmarkChanProdConsWork0-4    1913.00       611.00  -68.06%
BenchmarkChanProdConsWork0-8    3016.00       949.00  -68.53%
BenchmarkChanProdConsWork0-16   4320.00      1154.00  -73.29%
BenchmarkChanProdConsWork10     1906.00      1897.00   -0.47%
BenchmarkChanProdConsWork10-2   1123.00      1033.00   -8.01%
BenchmarkChanProdConsWork10-4   1076.00       571.00  -46.93%
BenchmarkChanProdConsWork10-8   2748.00      1096.00  -60.12%
BenchmarkChanProdConsWork10-16  4600.00      1105.00  -75.98%
BenchmarkChanProdConsWork100    1884.00      1852.00   -1.70%
BenchmarkChanProdConsWork100-2  1235.00      1146.00   -7.21%
BenchmarkChanProdConsWork100-4  1217.00       619.00  -49.14%
BenchmarkChanProdConsWork100-8  1534.00       509.00  -66.82%
BenchmarkChanProdConsWork100-16 4126.00       918.00  -77.75%
BenchmarkSyscall                  34.40        33.30   -3.20%
BenchmarkSyscall-2               160.00       121.00  -24.38%
BenchmarkSyscall-4               131.00       136.00   +3.82%
BenchmarkSyscall-8               139.00       131.00   -5.76%
BenchmarkSyscall-16              161.00       168.00   +4.35%
BenchmarkSyscallWork             950.00       950.00   +0.00%
BenchmarkSyscallWork-2           481.00       480.00   -0.21%
BenchmarkSyscallWork-4           268.00       270.00   +0.75%
BenchmarkSyscallWork-8           156.00       169.00   +8.33%
BenchmarkSyscallWork-16          188.00       184.00   -2.13%
BenchmarkSemaSyntNonblock         36.40        35.60   -2.20%
BenchmarkSemaSyntNonblock-2       81.40        45.10  -44.59%
BenchmarkSemaSyntNonblock-4      126.00       108.00  -14.29%
BenchmarkSemaSyntNonblock-8      112.00       112.00   +0.00%
BenchmarkSemaSyntNonblock-16     110.00       112.00   +1.82%
BenchmarkSemaSyntBlock            35.30        35.30   +0.00%
BenchmarkSemaSyntBlock-2         118.00       124.00   +5.08%
BenchmarkSemaSyntBlock-4         105.00       108.00   +2.86%
BenchmarkSemaSyntBlock-8         101.00       111.00   +9.90%
BenchmarkSemaSyntBlock-16        112.00       118.00   +5.36%
BenchmarkSemaWorkNonblock        810.00       811.00   +0.12%
BenchmarkSemaWorkNonblock-2      476.00       414.00  -13.03%
BenchmarkSemaWorkNonblock-4      238.00       228.00   -4.20%
BenchmarkSemaWorkNonblock-8      140.00       126.00  -10.00%
BenchmarkSemaWorkNonblock-16     117.00       116.00   -0.85%
BenchmarkSemaWorkBlock           810.00       811.00   +0.12%
BenchmarkSemaWorkBlock-2         454.00       466.00   +2.64%
BenchmarkSemaWorkBlock-4         243.00       241.00   -0.82%
BenchmarkSemaWorkBlock-8         145.00       137.00   -5.52%
BenchmarkSemaWorkBlock-16        132.00       123.00   -6.82%
BenchmarkContendedSemaphore      123.00       102.00  -17.07%
BenchmarkContendedSemaphore-2     34.80        34.90   +0.29%
BenchmarkContendedSemaphore-4     34.70        34.80   +0.29%
BenchmarkContendedSemaphore-8     34.70        34.70   +0.00%
BenchmarkContendedSemaphore-16    34.80        34.70   -0.29%
BenchmarkMutex                    26.80        26.00   -2.99%
BenchmarkMutex-2                 108.00        45.20  -58.15%
BenchmarkMutex-4                 103.00       127.00  +23.30%
BenchmarkMutex-8                 109.00       147.00  +34.86%
BenchmarkMutex-16                102.00       152.00  +49.02%
BenchmarkMutexSlack               27.00        26.90   -0.37%
BenchmarkMutexSlack-2            149.00       165.00  +10.74%
BenchmarkMutexSlack-4            121.00       209.00  +72.73%
BenchmarkMutexSlack-8            101.00       158.00  +56.44%
BenchmarkMutexSlack-16            97.00       129.00  +32.99%
BenchmarkMutexWork               792.00       794.00   +0.25%
BenchmarkMutexWork-2             407.00       409.00   +0.49%
BenchmarkMutexWork-4             220.00       209.00   -5.00%
BenchmarkMutexWork-8             267.00       160.00  -40.07%
BenchmarkMutexWork-16            315.00       300.00   -4.76%
BenchmarkMutexWorkSlack          792.00       793.00   +0.13%
BenchmarkMutexWorkSlack-2        406.00       404.00   -0.49%
BenchmarkMutexWorkSlack-4        225.00       212.00   -5.78%
BenchmarkMutexWorkSlack-8        268.00       136.00  -49.25%
BenchmarkMutexWorkSlack-16       300.00       300.00   +0.00%
BenchmarkRWMutexWrite100          27.10        27.00   -0.37%
BenchmarkRWMutexWrite100-2        33.10        40.80  +23.26%
BenchmarkRWMutexWrite100-4       113.00        88.10  -22.04%
BenchmarkRWMutexWrite100-8       119.00        95.30  -19.92%
BenchmarkRWMutexWrite100-16      148.00       109.00  -26.35%
BenchmarkRWMutexWrite10           29.60        29.40   -0.68%
BenchmarkRWMutexWrite10-2        111.00        61.40  -44.68%
BenchmarkRWMutexWrite10-4        270.00       208.00  -22.96%
BenchmarkRWMutexWrite10-8        204.00       185.00   -9.31%
BenchmarkRWMutexWrite10-16       261.00       190.00  -27.20%
BenchmarkRWMutexWorkWrite100    1040.00      1036.00   -0.38%
BenchmarkRWMutexWorkWrite100-2   593.00       580.00   -2.19%
BenchmarkRWMutexWorkWrite100-4   470.00       365.00  -22.34%
BenchmarkRWMutexWorkWrite100-8   468.00       289.00  -38.25%
BenchmarkRWMutexWorkWrite100-16  604.00       374.00  -38.08%
BenchmarkRWMutexWorkWrite10      951.00       951.00   +0.00%
BenchmarkRWMutexWorkWrite10-2   1001.00       928.00   -7.29%
BenchmarkRWMutexWorkWrite10-4   1555.00      1006.00  -35.31%
BenchmarkRWMutexWorkWrite10-8   2085.00      1171.00  -43.84%
BenchmarkRWMutexWorkWrite10-16  2082.00      1614.00  -22.48%

R=rsc, iant, msolo, fw, iant
CC=golang-dev
https://golang.org/cl/4711045

13 years agogc: fix pprof deadlock
Russ Cox [Fri, 29 Jul 2011 01:03:40 +0000 (21:03 -0400)]
gc: fix pprof deadlock

Fixes #2051.

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

13 years agogc: more graceful errors during struct definition
Russ Cox [Fri, 29 Jul 2011 00:41:18 +0000 (20:41 -0400)]
gc: more graceful errors during struct definition

Fixes #2110.

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

13 years agoexp/template: fix build
Rob Pike [Thu, 28 Jul 2011 23:46:32 +0000 (16:46 -0700)]
exp/template: fix build
TBR=gri

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

13 years agobuild: fix noclobber
Russ Cox [Thu, 28 Jul 2011 23:38:14 +0000 (19:38 -0400)]
build: fix noclobber

I got it backwards last time, and somehow
that was leaking into the parent shell?

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

13 years agoexp/template: simplify the helper functions
Rob Pike [Thu, 28 Jul 2011 23:19:16 +0000 (16:19 -0700)]
exp/template: simplify the helper functions
- create a pair of "Must" functions, one for templates, one for sets
- regularize the return values of the parsers so they can be wrapped by Must
- delete all the old Must functions and methods.

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

13 years ago5g, 6g, 8g: shift, opt fixes
Russ Cox [Thu, 28 Jul 2011 22:22:12 +0000 (18:22 -0400)]
5g, 6g, 8g: shift, opt fixes

Fixes #1808.

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

13 years ago5g: defer vs optimizer bug
Russ Cox [Thu, 28 Jul 2011 20:28:23 +0000 (16:28 -0400)]
5g: defer vs optimizer bug

Fixes #1924.

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

13 years agohttp: make serveFile redirects relative to work with StripPrefix
Andrew Balholm [Thu, 28 Jul 2011 18:43:16 +0000 (11:43 -0700)]
http: make serveFile redirects relative to work with StripPrefix

serveFile was using absolute redirects, which didn't work under StripPrefix.
Now it uses relative redirects.

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

13 years ago6g, 8g: divide corner case
Russ Cox [Thu, 28 Jul 2011 18:18:22 +0000 (14:18 -0400)]
6g, 8g: divide corner case

Fixes #1772.

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

13 years agobuild: handle spaces in $USER
Russ Cox [Thu, 28 Jul 2011 17:04:52 +0000 (13:04 -0400)]
build: handle spaces in $USER

Fixes #2107.

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

13 years agobuild: update all-qemu.bash
Russ Cox [Thu, 28 Jul 2011 17:04:30 +0000 (13:04 -0400)]
build: update all-qemu.bash

nothing but GOARCH=arm makes sense.
http/cgi uses network too.

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

13 years agogc: shift type bug
Russ Cox [Thu, 28 Jul 2011 17:03:30 +0000 (13:03 -0400)]
gc: shift type bug

Fixes #1664.

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

13 years agoexp/template: make Set.ParseFile etc resolve functions in the Set
Roger Peppe [Thu, 28 Jul 2011 16:59:20 +0000 (09:59 -0700)]
exp/template: make Set.ParseFile etc resolve functions in the Set
Fixes #2114

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

13 years agocgo: add GoBytes, fix gmp example
Russ Cox [Thu, 28 Jul 2011 16:39:50 +0000 (12:39 -0400)]
cgo: add GoBytes, fix gmp example

Fixes #1640.
Fixes #2007.

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

13 years agogc: another width test
Russ Cox [Thu, 28 Jul 2011 16:32:43 +0000 (12:32 -0400)]
gc: another width test

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

13 years agogc: line number + type checking nits
Russ Cox [Thu, 28 Jul 2011 16:31:16 +0000 (12:31 -0400)]
gc: line number + type checking nits

Fixes #1910.
Fixes #1979.
Fixes #1990.
Fixes #1993.
Fixes #2089.

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

13 years agoexp/template: make Set.MustParse* methods return the set.
Roger Peppe [Thu, 28 Jul 2011 15:41:06 +0000 (08:41 -0700)]
exp/template: make Set.MustParse* methods return the set.
This brings them into line with the Template.MustParse* methods
and makes it possible to use them in global variable initializations.

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

13 years agold: remove cseekend and redo pe writing
Alex Brainman [Thu, 28 Jul 2011 04:30:52 +0000 (14:30 +1000)]
ld: remove cseekend and redo pe writing

Simplify code and add more checks.

Fixes #2105.

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

13 years agorpc and exp/template: simplify tests for exported items
Rob Pike [Thu, 28 Jul 2011 04:26:16 +0000 (21:26 -0700)]
rpc and exp/template: simplify tests for exported items
Fix code to count mallocs - needed to call UpdateMemStats.

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

13 years agoimage/tiff: Do not panic when RowsPerStrip is missing.
Benny Siegert [Thu, 28 Jul 2011 01:15:59 +0000 (11:15 +1000)]
image/tiff: Do not panic when RowsPerStrip is missing.

The RowsPerStrip tag is mandatory according to the spec. However,
Mac OS sometimes (?) omits it. I managed to create such an image
by applying "tiffutil -none" on a compressed image.

If RowsPerStrip is 0, there was a division by zero in the decoder.
Assume that the image is a single strip in this case.

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

13 years agogc: top-level closure bug
Russ Cox [Wed, 27 Jul 2011 23:31:11 +0000 (19:31 -0400)]
gc: top-level closure bug

Fixes #2055.

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

13 years agogc: composite literal double eval bug
Russ Cox [Wed, 27 Jul 2011 22:55:30 +0000 (18:55 -0400)]
gc: composite literal double eval bug

Fixes #2086.

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

13 years agounicode: fix case-mapping for roman numerals!!
Rob Pike [Wed, 27 Jul 2011 22:54:23 +0000 (15:54 -0700)]
unicode: fix case-mapping for roman numerals!!
Hurray!
Also fix the mystical U+0345 COMBINING GREEK YPOGEGRAMMENI,
so everyone is satisfied.
Also add a -local flag to use local files for faster turnaround
when debugging.

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

13 years agocontainer/vector: removed some uses of container/vector in other pkgs
John Asmuth [Wed, 27 Jul 2011 22:23:42 +0000 (15:23 -0700)]
container/vector: removed some uses of container/vector in other pkgs

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

13 years agoA+C: John Asmuth
Andrew Gerrand [Wed, 27 Jul 2011 22:23:14 +0000 (15:23 -0700)]
A+C: John Asmuth

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

13 years agogodoc: app engine configuration and updated documentation
Robert Griesemer [Wed, 27 Jul 2011 22:14:12 +0000 (15:14 -0700)]
godoc: app engine configuration and updated documentation

Also: Fixed an error message in zip.go.

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

13 years agogc: use more Go-like names for methods
Russ Cox [Wed, 27 Jul 2011 21:56:13 +0000 (17:56 -0400)]
gc: use more Go-like names for methods

Fixes #991.

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

13 years agogc: diagnose (x) := 0
Russ Cox [Wed, 27 Jul 2011 21:39:30 +0000 (17:39 -0400)]
gc: diagnose (x) := 0

Fixes #1756.

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