• Rick Hudson's avatar
    [dev.garbage] runtime: add bit and cache ctz64 (count trailing zero) · 40934815
    Rick Hudson authored
    Add to each span a 64 bit cache (allocCache) of the allocBits
    at freeindex. allocCache is shifted such that the lowest bit
    corresponds to the bit freeindex. allocBits uses a 0 to
    indicate an object is free, on the other hand allocCache
    uses a 1 to indicate an object is free. This facilitates
    ctz64 (count trailing zero) which counts the number of 0s
    trailing the least significant 1. This is also the index of
    the least significant 1.
    
    Each span maintains a freeindex indicating the boundary
    between allocated objects and unallocated objects. allocCache
    is shifted as freeindex is incremented such that the low bit
    in allocCache corresponds to the bit a freeindex in the
    allocBits array.
    
    Currently ctz64 is written in Go using a for loop so it is
    not very efficient. Use of the hardware instruction will
    follow. With this in mind comparisons of the garbage
    benchmark are as follows.
    
    1.6 release        2.8 seconds
    dev:garbage branch 3.1 seconds.
    
    Profiling shows the go implementation of ctz64 takes up
    1% of the total time.
    
    Change-Id: If084ed9c3b1eda9f3c6ab2e794625cb870b8167f
    Reviewed-on: https://go-review.googlesource.com/20200Reviewed-by: 's avatarAustin Clements <austin@google.com>
    40934815
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
context Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
vendor/golang.org/x/net/http2/hpack Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
buildall.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...