• Robert Griesemer's avatar
    big: ~8x faster number scanning · ce2701b2
    Robert Griesemer authored
    - better number scanning algorithm
    - fixed a couple of bugs related to base interpretation
    - added scan benchmark
    - added more test cases and made tests more precise
    - introduced Int.scan method matching nat.scan
    - refactored Int.Scan; now uses int.scan
    - refactored Int.SetString; now uses int.scan
    
    There is more potential, this was a fairly simple change.
    
    gotest -test.bench="ScanPi" before/after (best of 3 runs):
    big.BenchmarkScanPi	   1000	    2024900 ns/op
    big.BenchmarkScanPi       10000      257540 ns/op
    
    R=chickencha
    CC=golang-dev, rsc
    https://golang.org/cl/4527089
    ce2701b2
int.go 17.9 KB