diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-12-03 15:07:28 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-12-03 15:07:28 +0000 |
commit | 214b3663d5d7598c13643f9221e43d5a7735b47f (patch) | |
tree | de779bab8dbcf057eaf481e6b612b63881e246e9 /rts/ProfHeap.c | |
parent | 7cb1d9274e84ee2fc2dd610aa4f7686586ca0357 (diff) | |
download | haskell-214b3663d5d7598c13643f9221e43d5a7735b47f.tar.gz |
GC refactoring, remove "steps"
The GC had a two-level structure, G generations each of T steps.
Steps are for aging within a generation, mostly to avoid premature
promotion.
Measurements show that more than 2 steps is almost never worthwhile,
and 1 step is usually worse than 2. In theory fractional steps are
possible, so the ideal number of steps is somewhere between 1 and 3.
GHC's default has always been 2.
We can implement 2 steps quite straightforwardly by having each block
point to the generation to which objects in that block should be
promoted, so blocks in the nursery point to generation 0, and blocks
in gen 0 point to gen 1, and so on.
This commit removes the explicit step structures, merging generations
with steps, thus simplifying a lot of code. Performance is
unaffected. The tunable number of steps is now gone, although it may
be replaced in the future by a way to tune the aging in generation 0.
Diffstat (limited to 'rts/ProfHeap.c')
-rw-r--r-- | rts/ProfHeap.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index b9fc7b309c..15337d4585 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -1067,7 +1067,7 @@ heapCensusChain( Census *census, bdescr *bd ) void heapCensus( void ) { - nat g, s; + nat g; Census *census; census = &censuses[era]; @@ -1085,17 +1085,11 @@ heapCensus( void ) #endif // Traverse the heap, collecting the census info - if (RtsFlags.GcFlags.generations == 1) { - heapCensusChain( census, g0->steps[0].blocks ); - } else { - for (g = 0; g < RtsFlags.GcFlags.generations; g++) { - for (s = 0; s < generations[g].n_steps; s++) { - heapCensusChain( census, generations[g].steps[s].blocks ); - // Are we interested in large objects? might be - // confusing to include the stack in a heap profile. - heapCensusChain( census, generations[g].steps[s].large_objects ); - } - } + for (g = 0; g < RtsFlags.GcFlags.generations; g++) { + heapCensusChain( census, generations[g].blocks ); + // Are we interested in large objects? might be + // confusing to include the stack in a heap profile. + heapCensusChain( census, generations[g].large_objects ); } // dump out the census info |