aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/binary/binary_test.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2022-08-26 21:48:21 +0700
committerShulhan <m.shulhan@gmail.com>2026-02-03 18:04:30 +0700
commitc4890d155ec1c8992857245260c119be9dc474c0 (patch)
tree852f90acc9af069c07fa0abfb98b32c51f77fb08 /src/encoding/binary/binary_test.go
parent011e40da85bddf83fee0ded83cb9115b7a88b3d4 (diff)
downloadgo-c4890d155ec1c8992857245260c119be9dc474c0.tar.xz
encoding/json: optimize isValidNumber function
Instead of re-slicing the string for checking the value, use single index variable. Benchmark result, name old time/op new time/op delta NumberIsValid-8 19.0ns ± 0% 14.5ns ± 1% -23.70% (p=0.008 n=5+5) name old alloc/op new alloc/op delta NumberIsValid-8 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta NumberIsValid-8 0.00 0.00 ~ (all equal) Change-Id: I4698c5db134998f83ff47fb3add6a04ba6ec3aa0
Diffstat (limited to 'src/encoding/binary/binary_test.go')
0 files changed, 0 insertions, 0 deletions