isValidNumber() performance can be optimized by avoiding substring creation in for loop.
benchstat oldBench.txt newBench.txt
name old time/op new time/op delta
NumberIsValid-8 39.3ns ± 1% 28.1ns ± 4% -28.53% (p=0.000 n=9+10)
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)
The text was updated successfully, but these errors were encountered:
isValidNumber()
performance can be optimized by avoiding substring creation in for loop.The text was updated successfully, but these errors were encountered: