<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/encoding, branch makepkg</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=makepkg</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=makepkg'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2026-02-03T11:04:30Z</updated>
<entry>
<title>encoding/json: realign struct encodeState, structFields, and field</title>
<updated>2026-02-03T11:04:30Z</updated>
<author>
<name>Shulhan</name>
<email>m.shulhan@gmail.com</email>
</author>
<published>2024-01-24T21:23:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=c1b21b3cccfeed8f8f6762410479ac03864cd30c'/>
<id>urn:sha1:c1b21b3cccfeed8f8f6762410479ac03864cd30c</id>
<content type='text'>
This reduce the struct encodeState size from 56 to 16 bytes (-42),
struct structFields size from 40 to 24 bytes (-16), and struct field size
from 136 to 128 bytes (-8).

Benchmark memory profiling before and after,

File: json.test
Type: alloc_space
Time: Jan 25, 2024 at 4:51am (WIB)
Showing nodes accounting for -4.01GB, 4.66% of 85.95GB total
Dropped 64 nodes (cum &lt;= 0.43GB)
      flat  flat%   sum%        cum   cum%
   -4.25GB  4.94%  4.94%    -4.01GB  4.67%  encoding/json.Marshal
    0.19GB  0.22%  4.73%     0.24GB  0.28%  encoding/json.mapEncoder.encode
    0.05GB 0.057%  4.67%     0.05GB 0.057%  reflect.copyVal
    0.04GB 0.049%  4.62%     0.04GB 0.049%  bytes.growSlice
   -0.04GB 0.045%  4.66%    -0.04GB 0.045%  encoding/json.RawMessage.MarshalJSON
         0     0%  4.66%     0.04GB 0.046%  bytes.(*Buffer).WriteString
         0     0%  4.66%     0.04GB 0.049%  bytes.(*Buffer).grow
         0     0%  4.66%    -0.04GB 0.045%  encoding/json.(*Encoder).Encode
         0     0%  4.66%     0.20GB  0.23%  encoding/json.(*encodeState).marshal
         0     0%  4.66%     0.20GB  0.23%  encoding/json.(*encodeState).reflectValue
</content>
</entry>
<entry>
<title>encoding/json: realign struct UnmarshalTypeError and decodeState</title>
<updated>2026-02-03T11:04:30Z</updated>
<author>
<name>Shulhan</name>
<email>m.shulhan@gmail.com</email>
</author>
<published>2024-01-24T21:18:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=c9f30d6b1840f109b2009fbf3081a97659e0927c'/>
<id>urn:sha1:c9f30d6b1840f109b2009fbf3081a97659e0927c</id>
<content type='text'>
This reduce the UnmarshalTypeError size from 64 to 56 bytes (-8 bytes),
and decodeState from 128 to 96 (-32 bytes).
</content>
</entry>
<entry>
<title>encoding/json: optimize isValidNumber function</title>
<updated>2026-02-03T11:04:30Z</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=c4890d155ec1c8992857245260c119be9dc474c0'/>
<id>urn:sha1:c4890d155ec1c8992857245260c119be9dc474c0</id>
<content type='text'>
Instead of re-slicing the string for checking the value, use single
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: use pooled encoder in Encoder.Encode</title>
<updated>2026-02-02T21:05:45Z</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2026-01-30T20:15:31Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=35abaf75c35adc9b22038885781b8be70a8476e0'/>
<id>urn:sha1:35abaf75c35adc9b22038885781b8be70a8476e0</id>
<content type='text'>
Due to the lack of MarshalWrite in the v1 API,
it is unfortunately common to see:

    json.NewEncoder(out).Encode(in)

where a single-use Encoder is constructed and thrown away.
This performed acceptably in v1 since every call to Encode
used a globally pooled encoder resource.

Prior to this change, the v1-in-v2 implementation relied
on a bytes.Buffer cached only for the lifetime of the Encoder
object itself. Thus, a single-use Encoder does not benefit.
Modify the wrapper implementation to use the internal
pooled encoder from v2 and use the intermediate buffer
to write directly to the output io.Writer.

We assume that the user-provided io.Writer never leaks the buffer,
but this assumption was already held in the v1 implementation.
We are not increasing the surface area of data corruption risk.

Performance of v1 to v1-in-v2 (before the pool fix):

	name                 old time/op    new time/op    delta
	NewEncoderEncode-32    30.2ms ± 4%    28.3ms ± 9%    -6.19%  (p=0.002 n=9+10)

	name                 old alloc/op   new alloc/op   delta
	NewEncoderEncode-32    7.64MB ± 0%   28.37MB ± 0%  +271.23%  (p=0.000 n=10+10)

	name                 old allocs/op  new allocs/op  delta
	NewEncoderEncode-32      200k ± 0%      100k ± 0%   -49.99%  (p=0.000 n=9+10)

Interestingly, v1-in-2 is slightly faster,
but the amount of allocated memory is massive.

Performance of v1 to v1-in-v2 (after the pool fix):

	name                 old time/op    new time/op    delta
	NewEncoderEncode-32    30.2ms ± 4%    24.0ms ± 7%  -20.36%  (p=0.000 n=9+10)

	name                 old alloc/op   new alloc/op   delta
	NewEncoderEncode-32    7.64MB ± 0%    4.09MB ± 3%  -46.52%  (p=0.000 n=10+10)

	name                 old allocs/op  new allocs/op  delta
	NewEncoderEncode-32      200k ± 0%      100k ± 0%  -50.00%  (p=0.000 n=9+9)

Now, the v1-in-v2 implementation is better than v1 on all metrics.

Fixes #75026

Change-Id: I50c975b1d5b8da806e46bc627966b0a39c1817eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/740660
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Damien Neil &lt;dneil@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>cmd/go,crypto/mlkem,crypto/x509,encoding/ascii85: clean up tautological/impossible nil conditions</title>
<updated>2026-01-30T15:54:05Z</updated>
<author>
<name>Neal Patel</name>
<email>nealpatel@google.com</email>
</author>
<published>2026-01-27T22:37:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=afae85307206cb56851c31652bd9ae45ba60c800'/>
<id>urn:sha1:afae85307206cb56851c31652bd9ae45ba60c800</id>
<content type='text'>
Change-Id: I3cdc599ebc93f5c9be5645e7ef7ce167242d9c1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/739800
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>encoding/json: fix typo in package doc.</title>
<updated>2026-01-24T02:08:03Z</updated>
<author>
<name>David Symonds</name>
<email>dsymonds@golang.org</email>
</author>
<published>2026-01-22T00:25:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=f8b72802d7a7dd2bcb81bdaead80be802e16351b'/>
<id>urn:sha1:f8b72802d7a7dd2bcb81bdaead80be802e16351b</id>
<content type='text'>
Change-Id: Id5520757e4d73e56e533e4de4f5f303105c4339e
Reviewed-on: https://go-review.googlesource.com/c/go/+/738180
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Auto-Submit: David Symonds &lt;dsymonds@golang.org&gt;
Reviewed-by: Carlos Amedee &lt;carlos@golang.org&gt;
Reviewed-by: David Symonds &lt;dsymonds@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Joseph Tsai &lt;joetsai@digital-static.net&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>encoding/json: remove unneeded unsafe import</title>
<updated>2026-01-22T22:29:44Z</updated>
<author>
<name>khr@golang.org</name>
<email>khr@golang.org</email>
</author>
<published>2025-12-23T15:41:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=26ffe78b8c34cea92a06690742b5d41b3397105f'/>
<id>urn:sha1:26ffe78b8c34cea92a06690742b5d41b3397105f</id>
<content type='text'>
Followon for CL 721160.

Change-Id: I9c22c5e99c9084e24047c77d20717c5b46165cde
Reviewed-on: https://go-review.googlesource.com/c/go/+/732220
Reviewed-by: Carlos Amedee &lt;carlos@golang.org&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Sean Liao &lt;sean@liao.dev&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>encoding/json/v2: remove issue reference in Duration formatting error</title>
<updated>2026-01-22T15:31:33Z</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2026-01-09T01:27:59Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=0152075d5aba0f198ac67fb426a0fc4c16e2b363'/>
<id>urn:sha1:0152075d5aba0f198ac67fb426a0fc4c16e2b363</id>
<content type='text'>
The json/v2 working group decided to commit to no default representation
for time.Duration for the foreseeable future.
Thus, we can remove the issue reference in the error message.

If JavaScript (TC39) formally adopts the Temporal.Duration type,
which uses ISO 8601 as the JSON representation for a duration,
we may consider changing the default.

Switching from no default to some default in the future
is generally a compatible change.

Updates #71631

Change-Id: I6f71a0fa97dcefba56aab0c0ddf445d9d38f6e58
Reviewed-on: https://go-review.googlesource.com/c/go/+/735080
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Damien Neil &lt;dneil@google.com&gt;
Auto-Submit: Joseph Tsai &lt;joetsai@digital-static.net&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>encoding/gob: clarify docs about pointers to zero values not being sent</title>
<updated>2025-12-29T20:45:08Z</updated>
<author>
<name>Oleg Zaytsev</name>
<email>mail@olegzaytsev.com</email>
</author>
<published>2025-12-26T20:11:01Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=0b06b68e21a3fbc75b3dd87c644da94828483a36'/>
<id>urn:sha1:0b06b68e21a3fbc75b3dd87c644da94828483a36</id>
<content type='text'>
The documentation on encoding/gob mentions that pointers are flattened,
and it also explicitly says that empty values are not sent.

A corollary of this, is that pointers to zero values are not sent, i.e.,
gob-encoding of *false becomes nil on the receiver side.

It is worth documenting this explicitly.

Change-Id: I1909203b8972e20791144bdda22e5f1b466aad97
GitHub-Last-Rev: 57764ec235ffe48484be98d3ed5269f0102ca4f8
GitHub-Pull-Request: golang/go#77009
Reviewed-on: https://go-review.googlesource.com/c/go/+/732820
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Sean Liao &lt;sean@liao.dev&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
</content>
</entry>
<entry>
<title>encoding/json/jsontext: add symbolic Kind constants</title>
<updated>2025-12-11T17:37:03Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2025-12-08T22:22:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=5818c9d714f1a8abeb76ec5d75ad0e0560e8d780'/>
<id>urn:sha1:5818c9d714f1a8abeb76ec5d75ad0e0560e8d780</id>
<content type='text'>
Add constants for each possible Kind value (KindNull, KindTrue, etc.).
Leave the values unchanged ('n', 't', etc.).
Update documentation to reference the symbols.

Fixes #71756

Change-Id: Ib33b2ad9ee55f6f547d9e6a1c5a7f00c8400d3d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/728420
Auto-Submit: Damien Neil &lt;dneil@google.com&gt;
Reviewed-by: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
</feed>
