1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:21:22 -06:00
Commit Graph

2806 Commits

Author SHA1 Message Date
Rob Pike
9ad091e178 gob: eliminate two more allocations in decode.
- just an oversight; we were reallocating a buffer.
- use unsafe to avoid allocating storage for a string twice.

R=rsc
CC=golang-dev
https://golang.org/cl/4290056
2011-03-17 10:47:42 -07:00
Russ Cox
2ca46a789b time: isolate syscall reference in sys.go
R=dsymonds
CC=golang-dev
https://golang.org/cl/4291052
2011-03-17 13:46:05 -04:00
Andrew Gerrand
75d4cb6a02 path/filepath: add EvalSymlinks function
R=rsc, niemeyer, r2, rog, iant2, r
CC=golang-dev
https://golang.org/cl/4235060
2011-03-17 16:36:37 +11:00
Ian Lance Taylor
4fd41e494a syscall: Permit non-blocking syscalls.
Permit system calls to be designated as non-blocking, meaning
that we simply call them without involving the scheduler.

This change by itself is mostly performance neutral.  In
combination with a following change to the net package there
is a performance advantage.

R=rsc, dfc, r2, iant2, rsc1
CC=golang-dev
https://golang.org/cl/4278055
2011-03-16 19:03:01 -07:00
Rob Pike
90f3f91786 gob: remove a few more allocations.
- use enc.err and dec.err instead of return values in deferred error catcher
- replace io.WriteString with buffer.WriteString

now at:
mallocs per encode of type Bench: 7
mallocs per decode of type Bench: 8

R=rsc
CC=golang-dev
https://golang.org/cl/4277057
2011-03-16 18:03:13 -07:00
Yasuhiro Matsumoto
3d1afb7680 path: work for windows.
R=brainman, rsc, rsc1
CC=golang-dev
https://golang.org/cl/4249064
2011-03-17 10:41:23 +11:00
Brad Fitzpatrick
a93f70c21a http: add NewProxyClientConn
This just returns a ClientConn suitable for writing
proxy requests.  To be used in Transport.

R=rsc, petar-m
CC=golang-dev
https://golang.org/cl/4290052
2011-03-16 14:32:35 -07:00
Robert Griesemer
7ea8cdaabd go/ast: merge CaseClause and TypeCaseClause
(per rsc's suggestion)

R=rsc
CC=golang-dev
https://golang.org/cl/4276057
2011-03-16 14:25:59 -07:00
Alex Brainman
de811cc04c go/scanner: use filepath
R=gri
CC=golang-dev
https://golang.org/cl/4280048
2011-03-16 10:38:03 -07:00
Rob Pike
d3c61fc214 testing: fix build
Dependency on bufio crept in during last CL; this breaks the cycle.
Also add a missing '-' to the documentation.

R=rsc
CC=golang-dev
https://golang.org/cl/4274061
2011-03-16 10:12:25 -07:00
Rob Pike
afaa30694c testing: add -test.memprofile and -test.memprofilerate flags.
These allow a test to generate memory profiles automatically.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4273064
2011-03-16 09:53:58 -07:00
Adam Langley
df184ff2f0 crypto/openpgp: add DSA signature support.
R=bradfitzgo, nsz
CC=golang-dev
https://golang.org/cl/4280041
2011-03-16 10:50:06 -04:00
Adam Langley
7b094182e4 crypto/ecdsa: truncate hash values.
There is some disagreement about how to deal with hash values larger
than the curve order size. We choose to follow OpenSSL's lead here.

R=bradfitzgo, r
CC=golang-dev
https://golang.org/cl/4273059
2011-03-16 10:42:41 -04:00
Rob Pike
eb864e92db gob: keep free lists of encoder and decoder states.
Avoids 3 mallocs in a round trip encoding/decoding a struct.

R=rsc, rsc1
CC=golang-dev
https://golang.org/cl/4278052
2011-03-15 21:30:07 -07:00
Robert Griesemer
bcd6c733b2 go/printer: output tuning for gofix
If braces don't have position information for a composite
literal, don't assume alignment of key:value pairs under
the (wrong) assumption that there may be multiple lines.

R=rsc
CC=golang-dev
https://golang.org/cl/4297043
2011-03-15 17:45:16 -07:00
Rob Pike
0463bd6cd7 gob: move benchmarks to a new timing_test.go file.
Add malloc counts for encode and decode.

R=rsc
CC=golang-dev
https://golang.org/cl/4290048
2011-03-15 17:14:02 -07:00
Russ Cox
b04209ca97 debug/proc: fix build
R=r
CC=golang-dev
https://golang.org/cl/4273060
2011-03-15 19:39:50 -04:00
Rob Pike
bc34cda742 rpc: add the ability to write out a memory profile during testing.
R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4290047
2011-03-15 14:20:30 -07:00
Rob Pike
f11f032486 rpc: add benchmarks
On my mac:
mallocs per rpc round trip: 144
rpc.BenchmarkEndToEnd	   10000	    228244 ns/op

Room for improvement.

R=rsc
CC=golang-dev
https://golang.org/cl/4274058
2011-03-15 13:09:11 -07:00
Roger Peppe
aa55c05213 os, syscall: add ProcAttr type. Change StartProcess etc. to use it.
The Windows code is untested.

R=rsc, gri, brainman, rsc1
CC=golang-dev
https://golang.org/cl/4253052
2011-03-15 14:41:19 -04:00
Russ Cox
a34f1bbb22 gofix: new command for updating code to new release
R=bradfitzgo, dsymonds, r, gri, adg
CC=golang-dev
https://golang.org/cl/4282044
2011-03-15 14:15:41 -04:00
Russ Cox
e72156b316 remove unused labels
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4274052
2011-03-15 14:05:07 -04:00
Brad Fitzpatrick
f192891786 httptest: default the Recorder status code to 200 on a Write
This matches the real ResponseWriter behavior.

R=rsc
CC=golang-dev
https://golang.org/cl/4291048
2011-03-15 10:13:25 -07:00
Brad Fitzpatrick
5245b27ed8 openpgp: add PublicKey KeyId string accessors
R=agl, agl1
CC=golang-dev
https://golang.org/cl/4297041
2011-03-15 10:06:17 -07:00
Rob Pike
a569725141 rpc: add buffering to the encode path.
This reduces the number of writes by 2 (1 client, 1 server) on each round trip.
A simple test shows 24% higher throughput.

R=rsc
CC=golang-dev
https://golang.org/cl/4279057
2011-03-15 10:02:44 -07:00
Dave Cheney
43ae7da190 crypto/tls: fix compile error
Fixes #1555.

R=rsc, bradfitzgo
CC=golang-dev
https://golang.org/cl/4284047
2011-03-12 19:35:41 -08:00
Brad Fitzpatrick
3479bb6c12 ioutil: add NopCloser
R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4278044
2011-03-12 16:05:07 -08:00
Brad Fitzpatrick
1c96562f36 http: use Header.Del not empty Set(k, "")
Also don't serialize empty headers.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/4275045
2011-03-12 09:58:53 -08:00
Rob Pike
a7528f1b81 runtime/proc.c: which to that
R=iant, dho
CC=golang-dev
https://golang.org/cl/4286044
2011-03-11 18:18:59 -08:00
Ian Lance Taylor
5e963a826c runtime: reduce lock contention via wakeup on scheduler unlock.
R=rsc
CC=golang-dev
https://golang.org/cl/4275043
2011-03-11 18:14:45 -08:00
Ian Lance Taylor
c01238a571 net: don't loop to drain wakeup pipe.
The loop always makes an extra system call.  It only makes a
difference if more than 100 goroutines started waiting for
something to happen on a network file descriptor since the
last time the pipe was drained, which is unlikely since we
will be woken up the first time a goroutine starts waiting.
If we don't drain the pipe this time, we'll be woken up again
right away and can drain again.

R=rsc
CC=golang-dev
https://golang.org/cl/4275042
2011-03-11 18:01:28 -08:00
Rob Pike
5df1cf0475 gob: use bufio on the decode to avoid a system call on each read.
Add a benchmark.
BenchmarkEndToEndPipe gives 14.3microseconds/op before,
13.1microseconds/op after, or about 76e3 round trips per second
through the kernel.
With a bytes buffer, and therefore no system calls for I/O, the
numbers go to 7.3microseconds/op, or about 137e3 round trips
per second.

R=rsc
CC=golang-dev
https://golang.org/cl/4279045
2011-03-11 16:24:09 -08:00
Robert Griesemer
c734b50b11 gotype: clean handling of stdin, added tests
- removed uses of global variables
- minor cleanups

R=r
CC=golang-dev
https://golang.org/cl/4277044
2011-03-11 16:15:33 -08:00
Robert Griesemer
86e35a96a7 go/typechecker: fix build
R=rsc
CC=golang-dev
https://golang.org/cl/4278043
2011-03-11 14:46:36 -08:00
Robert Griesemer
7664ec39b8 go/parser: first constant in a constant declaration must have a value
R=r, rsc1
CC=golang-dev
https://golang.org/cl/4291042
2011-03-11 14:33:31 -08:00
Russ Cox
591c74ad20 runtime: split non-debugging malloc interface out of debug.go into mem.go
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/4273045
2011-03-11 15:09:21 -05:00
Russ Cox
3f915f51a8 go code: replace closed(c) with x, ok := <-c
R=golang-dev, rog, bradfitzwork, r
CC=golang-dev
https://golang.org/cl/4243072
2011-03-11 14:47:44 -05:00
Russ Cox
8bf34e3356 gc, runtime: replace closed(c) with x, ok := <-c
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/4259064
2011-03-11 14:47:26 -05:00
Brad Fitzpatrick
d3d672998f http: rename interface Transport to RoundTripper
Transport.Do -> RoundTripper.RoundTrip

This makes way for a subsequent CL to export the
currently private RoundTripper implementation
as struct Transport.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4286043
2011-03-11 11:32:33 -08:00
Robert Griesemer
dbff0adaa7 gotype: commandline tool to typecheck go programs
First version. Handles scope analysis only at the
moment.

R=rsc, r, eds
CC=golang-dev
https://golang.org/cl/4259065
2011-03-11 10:27:25 -08:00
Brad Fitzpatrick
9554e67188 http: fix transport crash when request URL is nil
Fixes #1602

R=rsc, petar-m
CC=golang-dev
https://golang.org/cl/4284043
2011-03-11 09:54:31 -08:00
Robert Griesemer
478f08a517 io/ioutil: clean-up of ReadAll and ReadFile
Make ReadAll use the same mechanism as ReadFile.

R=r
CC=golang-dev
https://golang.org/cl/4279041
2011-03-10 16:41:54 -08:00
Robert Griesemer
2e8b375e0e go/ast: fix printing of maps
Print a newline after each map entry;
similar to the style used for slices
and structs.

R=r, r2
CC=golang-dev
https://golang.org/cl/4274042
2011-03-10 16:00:39 -08:00
Robert Griesemer
f1fee448bc go/ast: ast.Print needs a file set to print position values nicely
Also removed a TODO (AST nodes have been restructured a while ago).

R=r
CC=golang-dev
https://golang.org/cl/4245077
2011-03-10 12:54:33 -08:00
Rob Pike
034ca39e56 flag: visit the flags in sorted order, for better messages.
Fixes #1601.

R=rsc
CC=golang-dev
https://golang.org/cl/4249070
2011-03-10 12:42:31 -08:00
Brad Fitzpatrick
bbad6900ce http: run tests even with DISABLE_NET_TESTS=1
All tests are now localhost only.

R=rsc
CC=golang-dev
https://golang.org/cl/4271042
2011-03-10 10:19:11 -08:00
Brad Fitzpatrick
8e1fa76047 http: don't hit external network in client_test.go
More reliable.

R=rsc
CC=golang-dev
https://golang.org/cl/4249068
2011-03-10 08:46:57 -08:00
Brad Fitzpatrick
aae7b695ac http: move RemoteAddr & UsingTLS from ResponseWriter to Request
ResponseWriter.RemoteAddr() string -> Request.RemoteAddr string
ResponseWriter.UsingTLS() bool -> Request.TLS *tls.ConnectionState

R=rsc, bradfitzwork
CC=gburd, golang-dev
https://golang.org/cl/4248075
2011-03-10 08:17:22 -08:00
Adam Langley
ee23ab16da crypto/openpgp: s/serialise/serialize/
(No code changes, Americanization only.)

R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4250075
2011-03-10 10:36:04 -05:00
Brad Fitzpatrick
dc06ad5ad7 tls: move PeerCertificates to ConnectionState
R=agl, agl1
CC=golang-dev, rsc
https://golang.org/cl/4248078
2011-03-10 07:22:53 -08:00