• Russ Cox's avatar
    unicode: performance improvements (API change) · 4591cd63
    Russ Cox authored
    *** There is an API change here: the introduction of the
    LatinOffset int in the RangeTable struct. ***
    
    * Avoid checking Latin range multiple times for non-Latin runes.
    * Use linear search when it is faster than binary search.
    
    go test -calibrate runs the calibration for where the linear/binary
    crossover should be.
    
    benchmark                       old MB/s     new MB/s  speedup
    BenchmarkFields            36.27        41.43    1.14x
    BenchmarkFieldsFunc        36.23        41.38    1.14x
    
    The speedup here is evenly split between the linear scans
    and the LatinOffset change. Both are about 1.07x.
    
    R=r
    CC=bradfitz, gobot, golang-dev
    https://golang.org/cl/6526048
    4591cd63
tables.go 147 KB