aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/encoding/binary
AgeCommit message (Collapse)Author
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
2014-05-09encoding/binary: document that Read requires exported struct fieldsIan Lance Taylor
Add a test for the current behaviour. Fixes #7482. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://golang.org/cl/95160043
2014-01-27all: use {bytes,strings}.NewReader instead of bytes.BuffersBrad Fitzpatrick
Use the smaller read-only bytes.NewReader/strings.NewReader instead of a bytes.Buffer when possible. LGTM=r R=golang-codereviews, r CC=golang-codereviews https://golang.org/cl/54660045
2013-08-27encoding/binary: use bytes.Reader in read exampleMathieu Lonjaret
R=golang-dev, dave CC=golang-dev https://golang.org/cl/13274043
2013-08-14encoding/binary: make Write work like ReadRob Pike
Use the fast path calculation to shorten the code. No effect on benchmarks. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/12696046
2013-08-10encoding/binary: better description for intReadSizeRob Pike
It used to be called intDestSize; the new name is better too. R=bradfitz CC=golang-dev https://golang.org/cl/12713043
2013-08-10encoding/binary: fast path for reading slicesRob Pike
Again, it still allocates but the code is simple. benchmark old ns/op new ns/op delta BenchmarkReadSlice1000Int32s 35580 11465 -67.78% benchmark old MB/s new MB/s speedup BenchmarkReadSlice1000Int32s 112.42 348.86 3.10x R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12694048
2013-08-09encoding/binary: fix 32-bit buildRob Pike
Sigh. R=golang-dev CC=golang-dev https://golang.org/cl/12491045
2013-08-09encoding/binary: speed up writing slices of integersRob Pike
Simple approach. Still generates garbage, but not as much. benchmark old ns/op new ns/op delta BenchmarkWriteSlice1000Int32s 40260 18791 -53.33% benchmark old MB/s new MB/s speedup BenchmarkWriteSlice1000Int32s 99.35 212.87 2.14x Fixes #2634. R=golang-dev, crawshaw CC=golang-dev https://golang.org/cl/12680046
2013-08-09encoding/binary: document its goals betterRob Pike
It's a modest package with modest goals and limitations. Make that clear. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/12694043
2013-03-11all: remove now-unnecessary unreachable panicsBrad Fitzpatrick
Take advantage of the new terminating statement rule. R=golang-dev, r, gri CC=golang-dev https://golang.org/cl/7712044
2013-02-15encoding/binary: make type error more specificRuss Cox
Right now it says 'invalid type S' for a struct type S. Instead, say which type inside the struct is the problem. Fixes #4825. R=golang-dev, iant CC=golang-dev https://golang.org/cl/7301102
2012-11-22all: fix the the typosShenghou Ma
Fixes #4420. R=golang-dev, rsc, remyoudompheng CC=golang-dev https://golang.org/cl/6854080
2012-11-01encoding/binary: skip blank fields when (en/de)coding structsRobert Griesemer
- minor unrelated cleanups - performance impact in the noise benchmark old ns/op new ns/op delta BenchmarkReadSlice1000Int32s 83462 83346 -0.14% BenchmarkReadStruct 4141 4247 +2.56% BenchmarkReadInts 1588 1586 -0.13% BenchmarkWriteInts 1550 1489 -3.94% BenchmarkPutUvarint32 39 39 +1.02% BenchmarkPutUvarint64 142 144 +1.41% benchmark old MB/s new MB/s speedup BenchmarkReadSlice1000Int32s 47.93 47.99 1.00x BenchmarkReadStruct 16.90 16.48 0.98x BenchmarkReadInts 18.89 18.91 1.00x BenchmarkWriteInts 19.35 20.15 1.04x BenchmarkPutUvarint32 101.90 100.82 0.99x BenchmarkPutUvarint64 56.11 55.45 0.99x Fixes #4185. R=r, rsc CC=golang-dev https://golang.org/cl/6750053
2012-10-26encoding/binary: ReadVarint reads a signed number, not unsigned numberShenghou Ma
R=golang-dev, iant CC=golang-dev https://golang.org/cl/6762051
2012-07-22encoding/binary: fix typo: ReadVarint returns an int64, not a uint64.Patrick Mylund Nielsen
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/6432062
2012-03-05encoding/binary: improve package comment.Stefan Nilsson
The current package comment doesn't mention varints and protocol buffers. Also, the first sentence is incomprehensible without further context as "fixed-size values" is undefined. R=rsc CC=golang-dev https://golang.org/cl/5715048
2012-02-28encoding/binary: better exampleBrad Fitzpatrick
leave that joke to Java. R=golang-dev, adg CC=golang-dev https://golang.org/cl/5695080
2012-02-23binary: remove unnecessary dummy type.Stefan Nilsson
R=rsc CC=golang-dev https://golang.org/cl/5698052
2012-02-16godoc: make example code more readable with new comment conventionAndrew Gerrand
go/doc: move Examples to go/ast cmd/go: use go/doc to read examples src/pkg: update examples to use new convention This is to make whole file examples more readable. When presented as a complete function, preceding an Example with its output is confusing. The new convention is to put the expected output in the final comment of the example, preceded by the string "output:" (case insensitive). An idiomatic example looks like this: // This example demonstrates Foo by doing bar and quux. func ExampleFoo() { // example body that does bar and quux // Output: // example output } R=rsc, gri CC=golang-dev https://golang.org/cl/5673053
2012-02-10encoding/binary: another attempt to describe the type of Read and Write's dataRob Pike
R=golang-dev, rsc, gri, r CC=golang-dev https://golang.org/cl/5641062
2012-02-09encoding/binary: slices are allowed; say soRob Pike
Fixes #2629. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5642069
2012-02-09encoding/binary: add Size, to replace the functionality of the old TotalSizeRob Pike
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5644063
2012-02-08encoding/binary: hide TotalSizeRob Pike
The function has a bizarre signature: it was the only public function there that exposed the reflect package. Also, its definition is peculiar and hard to explain. It doesn't merit being exported. This is an API change but really, it should never have been exported and it's certain very few programs will depend on it: it's too weird. Fixes #2846. R=golang-dev, gri, bradfitz CC=golang-dev https://golang.org/cl/5639054
2012-01-30build: remove Make.pkg, Make.toolRuss Cox
Consequently, remove many package Makefiles, and shorten the few that remain. gomake becomes 'go tool make'. Turn off test phases of run.bash that do not work, flagged with $BROKEN. Future CLs will restore these, but this seemed like a big enough CL already. R=golang-dev, r CC=golang-dev https://golang.org/cl/5601057
2012-01-24encoding/binary: document that PutVarint, PutUvarint may panicBrad Fitzpatrick
Fixes #2628 R=golang-dev, gri CC=golang-dev https://golang.org/cl/5571058
2012-01-20encoding/varint: deleted WriteXvarintRobert Griesemer
Fixes #2748. R=rsc, r, r CC=golang-dev https://golang.org/cl/5557072
2011-12-20panics: use the new facilities of testing.B insteadRob Pike
Lots of panics go away. Also fix a name error in html/template. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5498045
2011-12-20encoding/binary: add more benchmarksRoger Peppe
Also add a byte count to the varint benchmarks - this isn't accurate, of course, but it allows a rough comparison to the other benchmarks. R=golang-dev, r CC=golang-dev https://golang.org/cl/5496070
2011-12-20encoding/binary: add Write and Read examplesAndrew Gerrand
R=golang-dev, r, adg CC=golang-dev https://golang.org/cl/5495095
2011-11-02all: sort importsRuss Cox
R=golang-dev, r CC=golang-dev https://golang.org/cl/5319072
2011-11-01src/pkg/[a-m]*: gofix -r error -force=errorRuss Cox
R=golang-dev, iant CC=golang-dev https://golang.org/cl/5322051
2011-10-27encoding/binary: fix type in testRuss Cox
Was working only accidentally. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5303082
2011-10-05encoding/binary: added benchmarksRobert Griesemer
binary.BenchmarkPutUvarint32 20000000 85.6 ns/op binary.BenchmarkPutUvarint64 10000000 299 ns/op R=rsc CC=golang-dev https://golang.org/cl/5148049
2011-09-29encoding/binary: PutX functions require buffer of sufficient size.Robert Griesemer
R=rsc CC=golang-dev https://golang.org/cl/5163041
2011-09-28encoding/binary: support for varint encodingRobert Griesemer
R=rsc, r, nigeltao, r, dsymonds CC=golang-dev https://golang.org/cl/5146048
2011-05-27encoding/binary: add a non-reflect fast path for WriteBrad Fitzpatrick
before/after: binary.BenchmarkWrite 100000 18312 ns/op binary.BenchmarkWrite 500000 4468 ns/op R=rsc, gri CC=golang-dev https://golang.org/cl/4515154
2011-05-26encoding/binary: add a non-reflect fast path for ReadBrad Fitzpatrick
before/after: binary.BenchmarkRead 200000 10860 ns/op binary.BenchmarkRead 500000 2846 ns/op R=rsc CC=golang-dev https://golang.org/cl/4547062
2011-04-25fix tree for reflect renameRuss Cox
R=golang-dev, r CC=golang-dev https://golang.org/cl/4435067
2011-04-13pkg: manual cleanup of some gofixed codeRuss Cox
R=golang-dev, niemeyer, r CC=golang-dev https://golang.org/cl/4372052
2011-04-08update go tree for reflect changesRuss Cox
R=golang-dev, r CC=golang-dev https://golang.org/cl/4353043
2011-02-11encoding/binary: update package doc string to be more comprehensiveAndrew Gerrand
R=r CC=golang-dev https://golang.org/cl/4128060
2011-01-19delete float, complex - code changesRuss Cox
also: cmplx -> complex float64(1.0) -> 1.0 float64(1) -> 1.0 R=gri, r, gri1, r2 CC=golang-dev https://golang.org/cl/3991043
2011-01-04encoding/binary: reject types with implementation-dependent sizesPatrick Gavlin
Fixes #1201. R=rsc CC=golang-dev https://golang.org/cl/3787044
2010-10-21encoding/binary: give LittleEndian, BigEndian specific typesRuss Cox
Giving them specific types has the benefit that binary.BigEndian.Uint32(b) is now a direct call, not an indirect via a mutable interface value, so it can potentially be inlined. Recent changes to the spec relaxed the rules for comparison, so this code is still valid: func isLittle(o binary.ByteOrder) { return o == binary.LittleEndian } The change does break this potential idiom: o := binary.BigEndian if foo { o = binary.LittleEndian } That must rewrite to give o an explicit binary.ByteOrder type. On balance I think the benefit from the direct call and inlining outweigh the cost of breaking that idiom. R=r, r2 CC=golang-dev https://golang.org/cl/2427042
2010-08-18build: no required environment variablesRuss Cox
R=adg, r, PeterGo CC=golang-dev https://golang.org/cl/1942044
2010-08-06encoding/binary: add complexRoger Peppe
R=rsc CC=golang-dev https://golang.org/cl/1879043
2010-06-20reflect: add Kind, remove Int8Type, Int8Value, etc.Russ Cox
update other code to match. R=r CC=golang-dev https://golang.org/cl/1680044
2010-03-03encoding/binary: fix error reporting bugRob Pike
R=rsc CC=golang-dev https://golang.org/cl/224096
2009-12-15 1) Change default gofmt default settings forRobert Griesemer
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 2nd set of files. R=rsc CC=golang-dev https://golang.org/cl/179067