<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/unicode, branch dev.boringcrypto</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>all: gofmt main repo</title>
<updated>2022-04-11T16:34:30+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2022-02-03T19:12:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=19309779ac5e2f5a2fd3cbb34421dafb2855ac21'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[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;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: remove trailing blank doc comment lines</title>
<updated>2022-04-01T18:18:07+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2022-01-31T01:11:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=690ac4071fa3e07113bf371c9e74394ab54d6749'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>unicode/utf8: optimize Valid to parity with ValidString</title>
<updated>2022-03-02T11:33:18+00:00</updated>
<author>
<name>Alan Donovan</name>
<email>alan@alandonovan.net</email>
</author>
<published>2022-01-05T14:20:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=fd2e1e743a86a53a30427cf3606543ecc9bd60bd'/>
<id>fd2e1e743a86a53a30427cf3606543ecc9bd60bd</id>
<content type='text'>
The benchmarks added in this change revealed that ValidString
runs ~17% faster than Valid([]byte) on the ASCII prefix
of the input. Inspection of the assembly revealed that the
code generated for p[8:] required recomputing the slice capacity
to handle the cap=0 special case, which added an ADD -8 instruction.
By making len=cap, the capacity becomes a common subexpression
with the length, saving the ADD instruction.
(Thanks to khr for the tip.)

Incidentally, I tried a number of other optimizations but was
unable to make consistent gains across all benchmarks. The most
promising was to retain the bitmask of non-ASCII bytes from the
fast loop; the slow loop would shift it, and when it becomes zero,
return to the fast loop. This made the MostlyASCII benchmark 4x
faster, but made the other cases slower by up to 10%.

cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
benchmark                                   old ns/op     new ns/op     delta
BenchmarkValidTenASCIIChars-16              4.09          4.06          -0.85%
BenchmarkValid100KASCIIChars-16             9325          7747          -16.92%
BenchmarkValidTenJapaneseChars-16           27.0          27.2          +0.85%
BenchmarkValidLongMostlyASCII-16            57277         58361         +1.89%
BenchmarkValidLongJapanese-16               94002         93131         -0.93%
BenchmarkValidStringTenASCIIChars-16        4.15          4.07          -1.74%
BenchmarkValidString100KASCIIChars-16       7980          8019          +0.49%
BenchmarkValidStringTenJapaneseChars-16     26.0          25.9          -0.38%
BenchmarkValidStringLongMostlyASCII-16      58550         58006         -0.93%
BenchmarkValidStringLongJapanese-16         97964         100038        +2.12%

Change-Id: Ic9d585dedd9af83c27dd791ecd805150ac949f15
Reviewed-on: https://go-review.googlesource.com/c/go/+/375594
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Trust: Alex Rakoczy &lt;alex@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The benchmarks added in this change revealed that ValidString
runs ~17% faster than Valid([]byte) on the ASCII prefix
of the input. Inspection of the assembly revealed that the
code generated for p[8:] required recomputing the slice capacity
to handle the cap=0 special case, which added an ADD -8 instruction.
By making len=cap, the capacity becomes a common subexpression
with the length, saving the ADD instruction.
(Thanks to khr for the tip.)

Incidentally, I tried a number of other optimizations but was
unable to make consistent gains across all benchmarks. The most
promising was to retain the bitmask of non-ASCII bytes from the
fast loop; the slow loop would shift it, and when it becomes zero,
return to the fast loop. This made the MostlyASCII benchmark 4x
faster, but made the other cases slower by up to 10%.

cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
benchmark                                   old ns/op     new ns/op     delta
BenchmarkValidTenASCIIChars-16              4.09          4.06          -0.85%
BenchmarkValid100KASCIIChars-16             9325          7747          -16.92%
BenchmarkValidTenJapaneseChars-16           27.0          27.2          +0.85%
BenchmarkValidLongMostlyASCII-16            57277         58361         +1.89%
BenchmarkValidLongJapanese-16               94002         93131         -0.93%
BenchmarkValidStringTenASCIIChars-16        4.15          4.07          -1.74%
BenchmarkValidString100KASCIIChars-16       7980          8019          +0.49%
BenchmarkValidStringTenJapaneseChars-16     26.0          25.9          -0.38%
BenchmarkValidStringLongMostlyASCII-16      58550         58006         -0.93%
BenchmarkValidStringLongJapanese-16         97964         100038        +2.12%

Change-Id: Ic9d585dedd9af83c27dd791ecd805150ac949f15
Reviewed-on: https://go-review.googlesource.com/c/go/+/375594
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Trust: Alex Rakoczy &lt;alex@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>unicode/utf8: add AppendRune Example</title>
<updated>2021-11-05T21:29:18+00:00</updated>
<author>
<name>jiahua wang</name>
<email>wjh180909@gmail.com</email>
</author>
<published>2021-10-07T07:30:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=75952abc6a8a8ad09e6bb1966c66b9a68b5d6c4e'/>
<id>75952abc6a8a8ad09e6bb1966c66b9a68b5d6c4e</id>
<content type='text'>
Also, correct TestAppendRune error message.

Change-Id: I3ca3ac7051af1ae6d449381b78efa86c2f6be8ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/354529
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Robert Findley &lt;rfindley@google.com&gt;
Trust: Cherry Mui &lt;cherryyz@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also, correct TestAppendRune error message.

Change-Id: I3ca3ac7051af1ae6d449381b78efa86c2f6be8ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/354529
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Robert Findley &lt;rfindley@google.com&gt;
Trust: Cherry Mui &lt;cherryyz@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>unicode: use IsSpace not IsUpper in IsSpace example test</title>
<updated>2021-10-08T00:18:29+00:00</updated>
<author>
<name>Pedro Lopez Mareque</name>
<email>pedro.lopez.mareque@gmail.com</email>
</author>
<published>2021-10-07T05:34:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=7cef83162bbe0008f3e158297b94a7dead64a9b1'/>
<id>7cef83162bbe0008f3e158297b94a7dead64a9b1</id>
<content type='text'>
Change-Id: Ie3017e5507f57cbb2ae9c8b737b378cef91fefeb
Reviewed-on: https://go-review.googlesource.com/c/go/+/354509
Reviewed-by: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ie3017e5507f57cbb2ae9c8b737b378cef91fefeb
Reviewed-on: https://go-review.googlesource.com/c/go/+/354509
Reviewed-by: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>unicode: add examples for the Is functions</title>
<updated>2021-10-06T23:19:13+00:00</updated>
<author>
<name>Pedro Lopez Mareque</name>
<email>pedro.lopez.mareque@gmail.com</email>
</author>
<published>2021-10-02T14:14:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=4707a6c284a9d8a0927cbc1badc6d09535a79bff'/>
<id>4707a6c284a9d8a0927cbc1badc6d09535a79bff</id>
<content type='text'>
Change-Id: If4afe33985dc0a758db32564244095190b82e5c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/353691
Trust: Michael Knyszek &lt;mknyszek@google.com&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: If4afe33985dc0a758db32564244095190b82e5c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/353691
Trust: Michael Knyszek &lt;mknyszek@google.com&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>unicode/utf8: add AppendRune</title>
<updated>2021-08-28T01:49:50+00:00</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2021-08-12T06:51:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=f371b30f326b66e4c5c13c7ea51358a42c431752'/>
<id>f371b30f326b66e4c5c13c7ea51358a42c431752</id>
<content type='text'>
AppendRune appends the UTF-8 encoding of a rune to a []byte.
It is a generally more user friendly than EncodeRune.

    EncodeASCIIRune-4     2.35ns ± 2%
    EncodeJapaneseRune-4  4.60ns ± 2%
    AppendASCIIRune-4     0.30ns ± 3%
    AppendJapaneseRune-4  4.70ns ± 2%

The ASCII case is written to be inlineable.

Fixes #47609

Change-Id: If4f71eedffd2bd4ef0d7f960cb55b41c637eec54
Reviewed-on: https://go-review.googlesource.com/c/go/+/345571
Trust: Joe Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Run-TryBot: Rob Pike &lt;r@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
AppendRune appends the UTF-8 encoding of a rune to a []byte.
It is a generally more user friendly than EncodeRune.

    EncodeASCIIRune-4     2.35ns ± 2%
    EncodeJapaneseRune-4  4.60ns ± 2%
    AppendASCIIRune-4     0.30ns ± 3%
    AppendJapaneseRune-4  4.70ns ± 2%

The ASCII case is written to be inlineable.

Fixes #47609

Change-Id: If4f71eedffd2bd4ef0d7f960cb55b41c637eec54
Reviewed-on: https://go-review.googlesource.com/c/go/+/345571
Trust: Joe Tsai &lt;joetsai@digital-static.net&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Run-TryBot: Rob Pike &lt;r@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>unicode: correctly handle negative runes</title>
<updated>2021-02-24T04:00:46+00:00</updated>
<author>
<name>David Benjamin</name>
<email>davidben@google.com</email>
</author>
<published>2020-12-25T17:02:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=37805292550e7144200b09320ffb61f21d421f8d'/>
<id>37805292550e7144200b09320ffb61f21d421f8d</id>
<content type='text'>
Is and isExcludingLatin did not handle negative runes when dispatching
to is16. TestNegativeRune covers this along with the existing uint32
casts in IsGraphic, etc. (For tests, I picked the smallest non-Latin-1
code point in each range.)

Updates #43254

Change-Id: I17261b91f0d2b5b5125d19219411b45c480df74f
Reviewed-on: https://go-review.googlesource.com/c/go/+/280493
Run-TryBot: Rob Pike &lt;r@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Is and isExcludingLatin did not handle negative runes when dispatching
to is16. TestNegativeRune covers this along with the existing uint32
casts in IsGraphic, etc. (For tests, I picked the smallest non-Latin-1
code point in each range.)

Updates #43254

Change-Id: I17261b91f0d2b5b5125d19219411b45c480df74f
Reviewed-on: https://go-review.googlesource.com/c/go/+/280493
Run-TryBot: Rob Pike &lt;r@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Trust: Emmanuel Odeke &lt;emmanuel@orijtech.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>unicode/utf8: document the handling of runes out of range in EncodeRune</title>
<updated>2020-09-19T09:43:15+00:00</updated>
<author>
<name>Ainar Garipov</name>
<email>gugl.zadolbal@gmail.com</email>
</author>
<published>2020-09-18T18:01:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a3868028ac8470d1ab7782614707bb90925e7fe3'/>
<id>a3868028ac8470d1ab7782614707bb90925e7fe3</id>
<content type='text'>
Document the way EncodeRune currently handles runes which are
out of range.  Also add an example showing that behaviour.

Change-Id: I0f8e7645ae053474ec319085a2bb6d7f73bc137c
Reviewed-on: https://go-review.googlesource.com/c/go/+/255998
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Reviewed-by: Giovanni Bajo &lt;rasky@develer.com&gt;
Trust: Giovanni Bajo &lt;rasky@develer.com&gt;
Run-TryBot: Giovanni Bajo &lt;rasky@develer.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Document the way EncodeRune currently handles runes which are
out of range.  Also add an example showing that behaviour.

Change-Id: I0f8e7645ae053474ec319085a2bb6d7f73bc137c
Reviewed-on: https://go-review.googlesource.com/c/go/+/255998
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Reviewed-by: Giovanni Bajo &lt;rasky@develer.com&gt;
Trust: Giovanni Bajo &lt;rasky@develer.com&gt;
Run-TryBot: Giovanni Bajo &lt;rasky@develer.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>unicode/utf8: refactor benchmarks for FullRune function</title>
<updated>2020-09-10T20:25:45+00:00</updated>
<author>
<name>eric fang</name>
<email>eric.fang@arm.com</email>
</author>
<published>2020-05-13T06:38:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a1762c2cc67822d86cb37747a56f0d4a07d24ced'/>
<id>a1762c2cc67822d86cb37747a56f0d4a07d24ced</id>
<content type='text'>
BenchmarkFullASCIIRune tests the performance of function utf8.FullRune,
which will be inlined in BenchmarkFullASCIIRune. Since the return value
of FullRune is not referenced, it will be removed as dead code.

This CL makes the FullRune functions return value referenced by a global
variable to avoid this point. In addition, this CL adds one more benchmark
to cover more code paths, and puts them together as sub benchmarks of
BenchmarkFullRune.

Change-Id: I6e79f4c087adf70e351498a4b58d7482dcd1ec4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/233979
Run-TryBot: eric fang &lt;eric.fang@arm.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BenchmarkFullASCIIRune tests the performance of function utf8.FullRune,
which will be inlined in BenchmarkFullASCIIRune. Since the return value
of FullRune is not referenced, it will be removed as dead code.

This CL makes the FullRune functions return value referenced by a global
variable to avoid this point. In addition, this CL adds one more benchmark
to cover more code paths, and puts them together as sub benchmarks of
BenchmarkFullRune.

Change-Id: I6e79f4c087adf70e351498a4b58d7482dcd1ec4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/233979
Run-TryBot: eric fang &lt;eric.fang@arm.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
