Commit a9581e2
unicode/utf16: speed up and clean up Encode and EncodeRune
name old time/op new time/op delta
EncodeValidASCII-4 74.1ns ± 1% 70.1ns ± 1% -5.46% (p=0.000 n=10+10)
EncodeValidJapaneseChars-4 61.3ns ± 0% 58.9ns ± 0% -3.82% (p=0.000 n=10+10)
EncodeRune-4 13.1ns ± 1% 9.8ns ± 0% -25.24% (p=0.000 n=10+9)
Fixes golang#6957
Change-Id: I9dde6d77420c34c6e2ef3e6213bb6be9b58a3074
Reviewed-on: https://go-review.googlesource.com/19891
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>1 parent 47b0422 commit a9581e2
1 file changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 68 | + | |
| 69 | + | |
72 | 70 | | |
73 | 71 | | |
74 | | - | |
| 72 | + | |
| 73 | + | |
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
0 commit comments