Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Repeat ¶ added in v1.20.0
Repeat is the go1.19 implementation of strings.Repeat.
In the go1.20 implementation, the function was changed to use chunks that are 8KB in size to improve speed and cache access. This change is faster when running native Go code. However, for GopherJS, the change is much slower than the go1.19 implementation.
The go1.20 change made tests like encoding/pem TestCVE202224675 take significantly longer to run for GopherJS. go1.19 concatenates 24 times and the test takes about 8 seconds. go1.20 concatenates about 15000 times and can take over a hour.
We can't use `js.InternalObject(s).Call("repeat", count).String()` because JS performs additional UTF-8 escapes meaning tests like hash/adler32 TestGolden will fail because the wrong input is created.
Types ¶
This section is empty.