cell-gc
cell-gc copied to clipboard
Non-moving generational GC via sticky mark bits
Doesn't seem to actually be a win yet, but it adds nice infrastructure and should be a win with a little bit more work.
A few things we can do:
-
Add a flag to
PageHeaderfor if anything in the page has been pinned. This should take a sizable constant time chunk out of root collection. -
Another flag to
PageHeaderfor if anything on the page has been marked. This way we can choose to only sweep whole pages of garbage at a time. This is independent of generational GC, but fits with its philosophy: focus work where its most likely to be effective, ignore other elsewhere. -
Revisit how incremental sweeping will work out with this new generational GCing.
-
Reuse the store buffer for rust heap to gc heap edges (would require some way to remove remembered edges when roots are un-pinned). This will allow much faster root enumeration, but perhaps at the price of costlier individual allocations.
-
Tweak the heuristics on when to do a generational GC vs full GC. Right now, it only happens when the store buffer is full (and I haven't even verified how often that happens, or if it is even happening at all). Also, how much more fuel a nursery collection should add to the
gc_counter.
GENERATIONAL W/ STICKY MARK BITS ===============================================
591777 rewrites
real 0m8.406s
user 0m6.873s
sys 0m0.714s
591777 rewrites
real 0m8.367s
user 0m6.834s
sys 0m0.703s
591777 rewrites
real 0m8.080s
user 0m6.603s
sys 0m0.670s
591777 rewrites
real 0m8.107s
user 0m6.621s
sys 0m0.670s
591777 rewrites
real 0m8.159s
user 0m6.666s
sys 0m0.686s
591777 rewrites
real 0m8.018s
user 0m6.556s
sys 0m0.660s
591777 rewrites
real 0m8.351s
user 0m6.825s
sys 0m0.709s
591777 rewrites
real 0m8.087s
user 0m6.601s
sys 0m0.670s
591777 rewrites
real 0m8.943s
user 0m7.263s
sys 0m0.802s
591777 rewrites
real 0m8.758s
user 0m7.081s
sys 0m0.780s
CONTROL ========================================================================
591777 rewrites
real 0m7.997s
user 0m6.513s
sys 0m0.686s
591777 rewrites
real 0m8.086s
user 0m6.581s
sys 0m0.698s
591777 rewrites
real 0m8.118s
user 0m6.593s
sys 0m0.702s
591777 rewrites
real 0m8.127s
user 0m6.631s
sys 0m0.691s
591777 rewrites
real 0m8.193s
user 0m6.690s
sys 0m0.702s
591777 rewrites
real 0m8.183s
user 0m6.679s
sys 0m0.702s
591777 rewrites
real 0m8.255s
user 0m6.748s
sys 0m0.699s
591777 rewrites
real 0m8.333s
user 0m6.816s
sys 0m0.709s
591777 rewrites
real 0m8.281s
user 0m6.738s
sys 0m0.715s
591777 rewrites
real 0m8.191s
user 0m6.676s
sys 0m0.711s