• Carl Shapiro's avatar
    runtime: check bitmap word for allocated bit in markonly · c51152f4
    Carl Shapiro authored
    When searching for an allocated bit, flushptrbuf would search
    backward in the bitmap word containing the bit of pointer
    being looked-up before searching the span.  This extra check
    was not replicated in markonly which, instead, after not
    finding an allocated bit for a pointer would directly look in
    the span.
    
    Using statistics generated from godoc, before this change span
    lookups were, on average, more common than word lookups.  It
    was common for markonly to consult spans for one third of its
    pointer lookups.  With this change in place, what were
    previously span lookups are overwhelmingly become by the word
    lookups making the total number of span lookups a relatively
    small fraction of the whole.
    
    This change also introduces some statistics gathering about
    lookups guarded by the CollectStats enum.
    
    R=golang-dev, khr
    CC=golang-dev
    https://golang.org/cl/13311043
    c51152f4
mgc0.c 66 KB