]> Cypherpunks repositories - gostls13.git/commit
runtime: make markrootSpans time proportional to in-use spans
authorAustin Clements <austin@google.com>
Wed, 5 Oct 2016 22:32:21 +0000 (18:32 -0400)
committerAustin Clements <austin@google.com>
Tue, 25 Oct 2016 22:32:59 +0000 (22:32 +0000)
commitc95a8e458fdf9f3cb0c176ac92a513e5dc9b32c1
tree49a4cccef0a056fd0f756f2d28a04a79726026fa
parentf9497a6747abe8738728eeb08f80849c88404d18
runtime: make markrootSpans time proportional to in-use spans

Currently markrootSpans iterates over all spans ever allocated to find
the in-use spans. Since we now have a list of in-use spans, change it
to iterate over that instead.

This, combined with the previous change, fixes #9265. Before these two
changes, blowing up the heap to 8GB and then shrinking it to a 0MB
live set caused the small-heap portion of the test to run 60x slower
than without the initial blowup. With these two changes, the time is
indistinguishable.

No significant effect on other benchmarks.

Change-Id: I4a27e533efecfb5d18cba3a87c0181a81d0ddc1e
Reviewed-on: https://go-review.googlesource.com/30536
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mgcmark.go
src/runtime/mgcsweepbuf.go