1
0
mirror of https://github.com/golang/go synced 2024-10-05 02:31:21 -06:00
Commit Graph

11 Commits

Author SHA1 Message Date
David Symonds
bf89d58e73 encoding/json: call (*T).MarshalJSON for addressable T values.
Fixes #2170.

R=golang-dev, cw, adg
CC=golang-dev
https://golang.org/cl/5618045
2012-02-03 11:15:06 +11:00
Mikio Hara
d4fe9c6a9d encoding/json: fix comments, tweak tests for tag names
R=bradfitz
CC=golang-dev
https://golang.org/cl/5558047
2012-01-19 15:33:29 +09:00
Brad Fitzpatrick
b39c883e29 encoding/json: allow / and % in tag names
Fixes #2718

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5532095
2012-01-18 19:05:15 -08:00
David Symonds
6e285ebade encoding/json: document angle bracket escaping.
Fixes #2643.

R=rsc, d_smithson
CC=golang-dev
https://golang.org/cl/5543068
2012-01-18 12:56:24 +11:00
Evan Shaw
c20c09251c encoding/json: don't marshal special float values
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5500084
2012-01-03 12:30:18 +11:00
Brad Fitzpatrick
29264c6f4f json: use strconv.Append variants to avoid allocations in encoding
Before/after, best of 3:
json.BenchmarkCodeEncoder  10  183495300 ns/op  10.58 MB/s
->
json.BenchmarkCodeEncoder  10  133025100 ns/op  14.59 MB/s

But don't get too excited about this.  These benchmarks, while
stable at any point of time, fluctuate wildly with any line of
code added or removed anywhere in the path due to stack splitting
issues.

It's currently much faster, though, and this is the API that
doesn't allocate so should always be faster in theory.

R=golang-dev, dsymonds, rsc, r, gri
CC=golang-dev
https://golang.org/cl/5411052
2011-12-15 11:21:21 -08:00
Rob Pike
34c7765fe5 json: treat renamed byte slices the same as []byte
Fixes #2163.

R=rsc
CC=golang-dev
https://golang.org/cl/5488068
2011-12-14 11:03:28 -08:00
Russ Cox
2666b815a3 use new strconv API
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.

No attempt is made to use the new Append functions
even though there are definitely opportunities.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
2011-12-05 15:48:46 -05:00
Brad Fitzpatrick
6c9f466273 json: speed up encoding, caching reflect calls
Before
json.BenchmarkCodeEncoder  10  181232100 ns/op  10.71 MB/s
json.BenchmarkCodeMarshal  10  184578000 ns/op  10.51 MB/s

After:
json.BenchmarkCodeEncoder  10  146444000 ns/op  13.25 MB/s
json.BenchmarkCodeMarshal  10  151428500 ns/op  12.81 MB/s

R=rsc, r
CC=golang-dev
https://golang.org/cl/5416046
2011-11-21 07:49:14 -08:00
Rob Pike
30aa701fec renaming_2: gofix -r go1pkgrename src/pkg/[a-l]*
R=rsc
CC=golang-dev
https://golang.org/cl/5358041
2011-11-08 15:40:58 -08:00
Rob Pike
f4cd80224a encoding: move asn1, csv, gob, json, xml into encoding
This is Go 1 package renaming CL #1.
This one merely moves the source; the import strings will be
changed after the next weekly release.

The only edits are in Makefiles.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5331060
2011-11-03 11:39:52 -07:00