• Josh Bleecher Snyder's avatar
    runtime: iterate over set bits in adjustpointers · 5af0b28a
    Josh Bleecher Snyder authored
    There are several things combined in this change.
    
    First, eliminate the gobitvector type in favor
    of adding a ptrbit method to bitvector.
    In non-performance-critical code, use that method.
    In performance critical code, though, load the bitvector data
    one byte at a time and iterate only over set bits.
    To support that, add and use sys.Ctz8.
    
    name                old time/op  new time/op  delta
    StackCopyPtr-8      81.8ms ± 5%  78.9ms ± 3%   -3.58%  (p=0.000 n=97+96)
    StackCopy-8         65.9ms ± 3%  62.8ms ± 3%   -4.67%  (p=0.000 n=96+92)
    StackCopyNoCache-8   105ms ± 3%   102ms ± 3%   -3.38%  (p=0.000 n=96+95)
    
    Change-Id: I00b80f45612708bd440b1a411a57fa6dfa24aa74
    Reviewed-on: https://go-review.googlesource.com/109716
    Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAustin Clements <austin@google.com>
    5af0b28a
mbitmap.go 65.6 KB