]> Cypherpunks.ru repositories - gostls13.git/commit
unicode/utf8: reduce bounds checks in EncodeRune
authorMartin Möhrmann <martisch@uos.de>
Sat, 3 Sep 2016 16:39:25 +0000 (18:39 +0200)
committerMartin Möhrmann <martisch@uos.de>
Sat, 3 Sep 2016 20:05:36 +0000 (20:05 +0000)
commitfd41951c2b243a80e7b2b5d28a90839c928cfd2e
treefe0c38ec752579fb9cd4c51bcc7f58e5a9e845fd
parent38abd43b6a4d215375901d137a3eac9d0d3393a5
unicode/utf8: reduce bounds checks in EncodeRune

Provide bounds elim hints in EncodeRune.

name                  old time/op  new time/op  delta
EncodeASCIIRune-4     2.69ns ± 2%  2.69ns ± 2%    ~     (p=0.193 n=47+46)
EncodeJapaneseRune-4  5.97ns ± 2%  5.38ns ± 2%  -9.93%  (p=0.000 n=49+50)

Change-Id: I1a6dcffff3bdd64ab93c2130021e3b00981de4c8
Reviewed-on: https://go-review.googlesource.com/28492
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/unicode/utf8/utf8.go