<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/bytes/buffer.go, branch fix-runtime-test-GOMAXPROCS</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=fix-runtime-test-GOMAXPROCS</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=fix-runtime-test-GOMAXPROCS'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2025-05-19T17:38:56Z</updated>
<entry>
<title>strings,bytes: add internal docs about perennial noCopy questions</title>
<updated>2025-05-19T17:38:56Z</updated>
<author>
<name>Alan Donovan</name>
<email>adonovan@google.com</email>
</author>
<published>2025-05-19T17:05:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=a74ae952826fd65006a8190c50bbbee4c4869cf9'/>
<id>urn:sha1:a74ae952826fd65006a8190c50bbbee4c4869cf9</id>
<content type='text'>
Updates #26462
Updates #25907
Updates #47276
Updates #48398

Change-Id: Ic64fc8d0c284f6e5aa383a8d417fa5768dcd7925
Reviewed-on: https://go-review.googlesource.com/c/go/+/674096
Auto-Submit: Alan Donovan &lt;adonovan@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
</content>
</entry>
<entry>
<title>strings,bytes: use result of copy in subsequent slicing</title>
<updated>2024-10-29T16:47:05Z</updated>
<author>
<name>Keith Randall</name>
<email>khr@golang.org</email>
</author>
<published>2024-10-28T21:15:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=4b30a40d8856cc3f6c8f629a9f825feeaf9848af'/>
<id>urn:sha1:4b30a40d8856cc3f6c8f629a9f825feeaf9848af</id>
<content type='text'>
This can get rid of a bounds check.
Followup to CL 622240.

Change-Id: I9d0a2c0408b8d274c46136d32d7a5fb09b4aad1c
Reviewed-on: https://go-review.googlesource.com/c/go/+/622955
Reviewed-by: David Chase &lt;drchase@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
</content>
</entry>
<entry>
<title>bytes: more cross-references in docstrings</title>
<updated>2024-07-16T18:17:37Z</updated>
<author>
<name>Kir Kolyshkin</name>
<email>kolyshkin@gmail.com</email>
</author>
<published>2024-07-11T18:31:46Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=9915b8705948f9118d7f4865d433d05a31ce0433'/>
<id>urn:sha1:9915b8705948f9118d7f4865d433d05a31ce0433</id>
<content type='text'>
Change-Id: Iea0243edcf8bf73ce325695178a3ea5cfe420d31
Reviewed-on: https://go-review.googlesource.com/c/go/+/597775
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>bytes,strings: add available godoc link</title>
<updated>2023-10-13T17:10:31Z</updated>
<author>
<name>cui fliter</name>
<email>imcusg@gmail.com</email>
</author>
<published>2023-10-12T03:49:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=6dd7462a04e2ce0a3e91cdb8fd85e98ac62ba0aa'/>
<id>urn:sha1:6dd7462a04e2ce0a3e91cdb8fd85e98ac62ba0aa</id>
<content type='text'>
Change-Id: Id9706a783d3321e3706eeee102286522e7968efd
Reviewed-on: https://go-review.googlesource.com/c/go/+/534775
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
</content>
</entry>
<entry>
<title>all: fix misuses of "a" vs "an"</title>
<updated>2023-04-04T14:20:53Z</updated>
<author>
<name>cui fliter</name>
<email>imcusg@gmail.com</email>
</author>
<published>2023-03-30T16:00:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=d8d22664c65b0054fc9ea6ba7e945481348fc8fc'/>
<id>urn:sha1:d8d22664c65b0054fc9ea6ba7e945481348fc8fc</id>
<content type='text'>
Fixes the misuse of "a" vs "an", according to English grammatical
expectations and using https://www.a-or-an.com/

Change-Id: I53ac724070e3ff3d33c304483fe72c023c7cda47
Reviewed-on: https://go-review.googlesource.com/c/go/+/480536
Run-TryBot: shuang cui &lt;imcusg@gmail.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
</content>
</entry>
<entry>
<title>bytes: add Buffer.Available and Buffer.AvailableBuffer</title>
<updated>2023-03-13T17:03:14Z</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2023-02-06T19:37:39Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=e671fe0c3efc497397af3362a4b79c895fbd8bfc'/>
<id>urn:sha1:e671fe0c3efc497397af3362a4b79c895fbd8bfc</id>
<content type='text'>
This adds a new Buffer.AvailableBuffer method that returns
an empty buffer with a possibly non-empty capacity for use
with append-like APIs.

The typical usage pattern is something like:

	b := bb.AvailableBuffer()
	b = appendValue(b, v)
	bb.Write(b)

It allows logic combining append-like APIs with Buffer
to avoid needing to allocate and manage buffers themselves and
allows the append-like APIs to directly write into the Buffer.

The Buffer.Write method uses the builtin copy function,
which avoids copying bytes if the source and destination are identical.
Thus, Buffer.Write is a constant-time call for this pattern.

Performance:

	BenchmarkBufferAppendNoCopy  2.909 ns/op  5766942167.24 MB/s

This benchmark should only be testing the cost of bookkeeping
and never the copying of the input slice.
Thus, the MB/s should be orders of magnitude faster than RAM.

Fixes #53685

Change-Id: I0b41e54361339df309db8d03527689b123f99085
Reviewed-on: https://go-review.googlesource.com/c/go/+/474635
Run-TryBot: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Auto-Submit: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
</content>
</entry>
<entry>
<title>bytes: rely on utf8.AppendRune</title>
<updated>2022-08-23T20:26:47Z</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2022-06-16T00:03:27Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=70de482d17863e501be44450f8e60500a6f1b459'/>
<id>urn:sha1:70de482d17863e501be44450f8e60500a6f1b459</id>
<content type='text'>
This is both simpler and more performant.

WriteRune                                 23.9µs ± 1%   22.8µs ± 8%   -4.43%  (p=0.006 n=8+10)
ToUpper/longɐstringɐwithɐnonasciiⱯchars    573ns ± 4%    474ns ± 6%  -17.27%  (p=0.000 n=10+10)
ToUpper/ɐɐɐɐɐ                              236ns ± 6%    202ns ± 5%  -14.12%  (p=0.000 n=10+10)
ToUpper/a\u0080\U0010ffff                 98.8ns ± 6%   91.2ns ± 3%   -7.67%  (p=0.000 n=10+10)
ToLower/LONGⱯSTRINGⱯWITHⱯNONASCIIⱯCHARS    511ns ± 3%    409ns ± 4%  -20.02%  (p=0.000 n=10+10)
ToLower/ⱭⱭⱭⱭⱭ                              178ns ± 4%    173ns ± 2%   -2.76%  (p=0.005 n=10+10)
ToLower/A\u0080\U0010ffff                  100ns ± 3%     91ns ± 2%   -8.55%  (p=0.000 n=10+10)

Change-Id: I968ef194da2c115cbdcac2d3575c34c65e6a8a56
Reviewed-on: https://go-review.googlesource.com/c/go/+/412337
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Auto-Submit: Joseph Tsai &lt;joetsai@digital-static.net&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: David Chase &lt;drchase@google.com&gt;
Run-TryBot: Joseph Tsai &lt;joetsai@digital-static.net&gt;
</content>
</entry>
<entry>
<title>bytes: rely on runtime.growslice for growing</title>
<updated>2022-03-10T16:24:16Z</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2021-09-14T21:26:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=2d026a4ea5b28680c1ed7660f720c4cb028c5b35'/>
<id>urn:sha1:2d026a4ea5b28680c1ed7660f720c4cb028c5b35</id>
<content type='text'>
Rather than naively making a slice of capacity 2*c+n,
rely on the append(..., make(...)) pattern to allocate a
slice that aligns up to the closest size class.

Performance:
	name                          old time/op    new time/op    delta
	BufferWriteBlock/N4096       3.03µs ± 6%    2.04µs ± 6%  -32.60%  (p=0.000 n=10+10)
	BufferWriteBlock/N65536      47.8µs ± 6%    28.1µs ± 2%  -41.32%  (p=0.000 n=9+8)
	BufferWriteBlock/N1048576     844µs ± 7%     510µs ± 5%  -39.59%  (p=0.000 n=8+9)

	name                          old alloc/op   new alloc/op   delta
	BufferWriteBlock/N4096       12.3kB ± 0%     7.2kB ± 0%  -41.67%  (p=0.000 n=10+10)
	BufferWriteBlock/N65536       258kB ± 0%     130kB ± 0%  -49.60%  (p=0.000 n=10+10)
	BufferWriteBlock/N1048576    4.19MB ± 0%    2.10MB ± 0%  -49.98%  (p=0.000 n=10+8)

	name                          old allocs/op  new allocs/op  delta
	BufferWriteBlock/N4096         3.00 ± 0%      3.00 ± 0%     ~     (all equal)
	BufferWriteBlock/N65536        7.00 ± 0%      7.00 ± 0%     ~     (all equal)
	BufferWriteBlock/N1048576      11.0 ± 0%      11.0 ± 0%     ~     (all equal)

The performance is faster since the growth rate is capped at 2x,
while previously it could grow by amounts potentially much greater than 2x,
leading to significant amounts of memory waste and extra copying.

Credit goes to Martin Möhrmann for suggesting the
append(b, make([]T, n)...) pattern.

Fixes #42984
Updates #51462

Change-Id: I7b23f75dddbf53f8b8b93485bb1a1fff9649b96b
Reviewed-on: https://go-review.googlesource.com/c/go/+/349994
Trust: Joseph Tsai &lt;joetsai@digital-static.net&gt;
Trust: Josh Bleecher Snyder &lt;josharian@gmail.com&gt;
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Josh Bleecher Snyder &lt;josharian@gmail.com&gt;
</content>
</entry>
<entry>
<title>bytes: correct tense in comment</title>
<updated>2021-03-15T17:37:09Z</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2021-03-15T17:03:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=8ac6544564be04ed1c0bbf7831ad0f8ed1f067ed'/>
<id>urn:sha1:8ac6544564be04ed1c0bbf7831ad0f8ed1f067ed</id>
<content type='text'>
Undo incorrect change accidentally made in CL 299109.

Change-Id: Iba29827d0fbd3637c311cebc50c2f4ea437fc582
Reviewed-on: https://go-review.googlesource.com/c/go/+/301830
Trust: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Tobias Klauser &lt;tobias.klauser@gmail.com&gt;
</content>
</entry>
<entry>
<title>all: remove duplicate words</title>
<updated>2021-03-13T11:56:59Z</updated>
<author>
<name>John Bampton</name>
<email>jbampton@gmail.com</email>
</author>
<published>2021-03-13T11:25:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=289d34a465d46e5c5c07034f5d54afbfda06f5b9'/>
<id>urn:sha1:289d34a465d46e5c5c07034f5d54afbfda06f5b9</id>
<content type='text'>
Change-Id: Ib0469232a2b69a869e58d5d24990ad74ac96ea56
GitHub-Last-Rev: eb38e049ee1e773392ff3747e1eb2af20dd50dcd
GitHub-Pull-Request: golang/go#44805
Reviewed-on: https://go-review.googlesource.com/c/go/+/299109
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</content>
</entry>
</feed>
