]> Cypherpunks repositories - gostls13.git/commit
runtime: check bitmap word for allocated bit in markonly
authorCarl Shapiro <cshapiro@google.com>
Thu, 29 Aug 2013 20:52:38 +0000 (13:52 -0700)
committerCarl Shapiro <cshapiro@google.com>
Thu, 29 Aug 2013 20:52:38 +0000 (13:52 -0700)
commitc51152f438bf7b348de915b7b25fed343ea2a758
tree970469014d5ff784fb6accd97ddf64e8fd2a069e
parented467db6d8db16dcc2956d85f0ce114635e12f06
runtime: check bitmap word for allocated bit in markonly

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
src/pkg/runtime/mgc0.c