<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/encoding/json/encode.go, branch json-isValidNumber</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=json-isValidNumber</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=json-isValidNumber'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2023-02-18T09:15:58Z</updated>
<entry>
<title>encoding/json: optimize isValidNumber function</title>
<updated>2023-02-18T09:15:58Z</updated>
<author>
<name>Shulhan</name>
<email>m.shulhan@gmail.com</email>
</author>
<published>2022-08-26T14:48:21Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=02b962186be4ed9597df5fc526ef85b2e66cf55b'/>
<id>urn:sha1:02b962186be4ed9597df5fc526ef85b2e66cf55b</id>
<content type='text'>
We use an index instead of reslicing the string because reslicing a string
updates both the data and length fields instead of just the one index
variable.

Benchmark result,

name             old time/op    new time/op    delta
NumberIsValid-8  19.0ns ± 0%    14.5ns ± 1%  -23.70%  (p=0.008 n=5+5)

name             old alloc/op   new alloc/op   delta
NumberIsValid-8   0.00B          0.00B          ~     (all equal)

name             old allocs/op  new allocs/op  delta
NumberIsValid-8    0.00           0.00          ~     (all equal)

Change-Id: I4698c5db134998f83ff47fb3add6a04ba6ec3aa0
</content>
</entry>
<entry>
<title>encoding/json: give it a chance to put encodeState back in pool when error occurs</title>
<updated>2022-08-23T20:23:19Z</updated>
<author>
<name>Andy Pan</name>
<email>panjf2000@gmail.com</email>
</author>
<published>2022-08-13T18:29:33Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=e7f2e5697ac8b9b6ebfb3e0d059a8c318b4709eb'/>
<id>urn:sha1:e7f2e5697ac8b9b6ebfb3e0d059a8c318b4709eb</id>
<content type='text'>
name                       old time/op    new time/op    delta
CodeEncoderError-10           688µs ± 8%     496µs ±15%   -27.92%  (p=0.000 n=10+9)
CodeMarshalError-10           747µs ± 6%     546µs ± 4%   -26.86%  (p=0.000 n=10+10)
MarshalBytesError/32-10       284µs ± 2%     273µs ± 1%    -3.84%  (p=0.000 n=10+10)
MarshalBytesError/256-10      281µs ± 2%     278µs ± 4%      ~     (p=0.053 n=9+10)
MarshalBytesError/4096-10     290µs ± 1%     279µs ± 3%    -3.52%  (p=0.000 n=10+10)

name                       old speed      new speed      delta
CodeEncoderError-10        2.83GB/s ± 8%  3.84GB/s ±20%   +36.03%  (p=0.000 n=10+10)
CodeMarshalError-10        2.60GB/s ± 5%  3.56GB/s ± 4%   +36.61%  (p=0.000 n=10+10)

name                       old alloc/op   new alloc/op   delta
CodeEncoderError-10          4.05MB ± 1%    0.00MB ± 1%  -100.00%  (p=0.000 n=10+9)
CodeMarshalError-10          6.05MB ± 0%    1.99MB ± 1%   -67.13%  (p=0.000 n=10+10)
MarshalBytesError/32-10      66.0kB ± 0%     0.2kB ± 0%   -99.67%  (p=0.000 n=9+8)
MarshalBytesError/256-10     50.1kB ± 0%     0.9kB ± 0%   -98.23%  (p=0.000 n=9+9)
MarshalBytesError/4096-10    87.4kB ± 0%     7.5kB ± 0%   -91.47%  (p=0.000 n=8+10)

name                       old allocs/op  new allocs/op  delta
CodeEncoderError-10            25.0 ± 0%       4.0 ± 0%   -84.00%  (p=0.000 n=9+10)
CodeMarshalError-10            27.0 ± 0%       6.0 ± 0%   -77.78%  (p=0.000 n=10+10)
MarshalBytesError/32-10        18.0 ± 0%       5.0 ± 0%   -72.22%  (p=0.000 n=10+10)
MarshalBytesError/256-10       17.0 ± 0%       6.0 ± 0%   -64.71%  (p=0.000 n=10+10)
MarshalBytesError/4096-10      16.0 ± 0%       6.0 ± 0%   -62.50%  (p=0.000 n=10+10)

Change-Id: I48070bb05f55707251c694e40d2570403bbf61f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/423694
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: David Chase &lt;drchase@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>all: gofmt main repo</title>
<updated>2022-04-11T16:34:30Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2022-02-03T19:12:08Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=19309779ac5e2f5a2fd3cbb34421dafb2855ac21'/>
<id>urn:sha1:19309779ac5e2f5a2fd3cbb34421dafb2855ac21</id>
<content type='text'>
[This CL is part of a sequence implementing the proposal #51082.
The design doc is at https://go.dev/s/godocfmt-design.]

Run the updated gofmt, which reformats doc comments,
on the main repository. Vendored files are excluded.

For #51082.

Change-Id: I7332f099b60f716295fb34719c98c04eb1a85407
Reviewed-on: https://go-review.googlesource.com/c/go/+/384268
Reviewed-by: Jonathan Amsterdam &lt;jba@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
<entry>
<title>all: remove trailing blank doc comment lines</title>
<updated>2022-04-01T18:18:07Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2022-01-31T01:11:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=690ac4071fa3e07113bf371c9e74394ab54d6749'/>
<id>urn:sha1:690ac4071fa3e07113bf371c9e74394ab54d6749</id>
<content type='text'>
A future change to gofmt will rewrite

	// Doc comment.
	//
	func f()

to

	// Doc comment.
	func f()

Apply that change preemptively to all doc comments.

For #51082.

Change-Id: I4023e16cfb0729b64a8590f071cd92f17343081d
Reviewed-on: https://go-review.googlesource.com/c/go/+/384259
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>encoding/json: use reflect.Value.UnsafePointer over Pointer</title>
<updated>2022-03-02T17:42:53Z</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2021-11-02T19:01:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=5a03cbd12a2fcaf85482f1f4d9570c064510da9b'/>
<id>urn:sha1:5a03cbd12a2fcaf85482f1f4d9570c064510da9b</id>
<content type='text'>
The latter returns a uintptr, while the former returns a unsafe.Pointer.
A uintptr is unsafe if Go ever switches to a moving GC,
while a unsafe.Pointer will be properly tracked by the GC.

We do not use unsafe.Pointer for any unsafe type conversions,
and only use it for comparability purposes, which is relatively safe.

Updates #40592

Change-Id: I813e218668704b63a3043acda4331205a3835a66
Reviewed-on: https://go-review.googlesource.com/c/go/+/360855
Trust: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Trust: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Run-TryBot: Joseph Tsai &lt;joetsai@digital-static.net&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>all: gofmt -w -r 'interface{} -&gt; any' src</title>
<updated>2021-12-13T18:45:54Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2021-12-01T17:15:45Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=2580d0e08d5e9f979b943758d3c49877fb2324cb'/>
<id>urn:sha1:2580d0e08d5e9f979b943758d3c49877fb2324cb</id>
<content type='text'>
And then revert the bootstrap cmd directories and certain testdata.
And adjust tests as needed.

Not reverting the changes in std that are bootstrapped,
because some of those changes would appear in API docs,
and we want to use any consistently.
Instead, rewrite 'any' to 'interface{}' in cmd/dist for those directories
when preparing the bootstrap copy.

A few files changed as a result of running gofmt -w
not because of interface{} -&gt; any but because they
hadn't been updated for the new //go:build lines.

Fixes #49884.

Change-Id: Ie8045cba995f65bd79c694ec77a1b3d1fe01bb09
Reviewed-on: https://go-review.googlesource.com/c/go/+/368254
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>all: use reflect.{Pointer,PointerTo}</title>
<updated>2021-10-26T14:24:17Z</updated>
<author>
<name>Cuong Manh Le</name>
<email>cuong.manhle.vn@gmail.com</email>
</author>
<published>2021-10-25T16:00:56Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=283d8a3d53ac1c7e1d7e297497480bf0071b6300'/>
<id>urn:sha1:283d8a3d53ac1c7e1d7e297497480bf0071b6300</id>
<content type='text'>
Updates #47651
Updates #48665

Change-Id: I69a87b45a5cad7a07fbd855040cd9935cf874554
Reviewed-on: https://go-review.googlesource.com/c/go/+/358454
Trust: Cuong Manh Le &lt;cuong.manhle.vn@gmail.com&gt;
Run-TryBot: Cuong Manh Le &lt;cuong.manhle.vn@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
</entry>
<entry>
<title>encoding/json: marshal maps using reflect.Value.MapRange</title>
<updated>2021-03-05T02:28:11Z</updated>
<author>
<name>Meng Zhuo</name>
<email>mzh@golangcn.org</email>
</author>
<published>2021-01-21T14:53:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=a7526bbf72dfe0fde00d88f85fd6cddccdb3a345'/>
<id>urn:sha1:a7526bbf72dfe0fde00d88f85fd6cddccdb3a345</id>
<content type='text'>
Map serialization using reflect.Value.MapIndex cannot retrieve
map keys that contain a NaN, resulting in a panic.
Switch the implementation to use the reflect.Value.MapRange method
instead, which iterates over all map entries regardless of whether
they are directly retrievable.

Note that according to RFC 8259, section 4, a JSON object should
have unique names, but does not forbid the occurrence of duplicate names.

Fixes #43207

Change-Id: If4bc55229b1f64b8ca4b0fed37549725efdace39
Reviewed-on: https://go-review.googlesource.com/c/go/+/278632
Trust: Meng Zhuo &lt;mzh@golangcn.org&gt;
Trust: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Trust: Bryan C. Mills &lt;bcmills@google.com&gt;
Run-TryBot: Meng Zhuo &lt;mzh@golangcn.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
</content>
</entry>
<entry>
<title>reflect: add Method.IsExported and StructField.IsExported methods</title>
<updated>2021-02-25T21:21:51Z</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2020-10-15T01:41:16Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=b83d073e9eb4cbd0cd5ca530f576668c49f6d0f1'/>
<id>urn:sha1:b83d073e9eb4cbd0cd5ca530f576668c49f6d0f1</id>
<content type='text'>
The IsExported method is a more intuitive helper for checking whether
the method or field is exported than checking whether PkgPath is empty.

In the same CL, modify the standard library to make use of this helper.

Fixes #41563

Change-Id: Iaacfb3b74449501f98e2707aa32095a32bd3c3c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/266197
Trust: Joe Tsai &lt;joetsai@digital-static.net&gt;
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
<entry>
<title>encoding/json: added docs to UnsupportedValueError</title>
<updated>2020-09-25T19:10:05Z</updated>
<author>
<name>Carlos Alexandro Becker</name>
<email>caarlos0@gmail.com</email>
</author>
<published>2020-09-13T14:40:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=8266570ba71fd6af9c07d8fac945b3710010dfc7'/>
<id>urn:sha1:8266570ba71fd6af9c07d8fac945b3710010dfc7</id>
<content type='text'>
Added godoc to UnsupportedValueError.

Change-Id: I5fc13bac0b6e14b3a6eba27c9d3331ff5c5269aa
GitHub-Last-Rev: 516cd7a92903e1048caa4d560abf5d66339e5a8f
GitHub-Pull-Request: golang/go#41364
Reviewed-on: https://go-review.googlesource.com/c/go/+/254540
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Trust: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Trust: Heschi Kreinick &lt;heschi@google.com&gt;
Run-TryBot: Daniel Martí &lt;mvdan@mvdan.cc&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
</entry>
</feed>
