aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2022-08-26 21:48:21 +0700
committerShulhan <m.shulhan@gmail.com>2024-01-25 04:01:14 +0700
commite7b9ecb7a2ccb9d48da849a37bdb347b7de8f042 (patch)
tree33cfe93dc10cb69c55a5aee9f2827462d7355f2e /src/database/sql
parent65f7032d4ed53d7e8d605d72b294527a0eef6740 (diff)
downloadgo-e7b9ecb7a2ccb9d48da849a37bdb347b7de8f042.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/database/sql')
0 files changed, 0 insertions, 0 deletions