Make clearNursery free

Authored by simonmar on Oct 7 2014, 5:21 AM.



clearNursery resets all the bd->free pointers of nursery blocks to
make the blocks empty. In profiles we've seen clearNursery taking
significant amounts of time particularly with large -N and -A values.

This patch moves the work of clearNursery to the point at which we
actually need the new block, thereby introducing an invariant that
blocks to the right of the CurrentNursery pointer still need their
bd->free pointer reset. This should make things faster overall,
because we don't need to clear blocks that we don't use.

Test Plan


Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
simonmar updated this revision to Diff 796.Oct 7 2014, 5:21 AM
simonmar retitled this revision from to Make clearNursery free.
simonmar updated this object.
simonmar edited the test plan for this revision. (Show Details)
simonmar added reviewers: austin, AndreasVoellmy, ezyang.
ezyang accepted this revision.Oct 7 2014, 9:58 AM
ezyang edited edge metadata.

This is great; I recently cooked a similar patch but I didn't handle the reporting properly.

I think this solves

simonmar updated this revision to Diff 812.Oct 7 2014, 1:10 PM
simonmar edited edge metadata.

fix a bug

AndreasVoellmy accepted this revision.Oct 7 2014, 3:09 PM
AndreasVoellmy edited edge metadata.

Cool! Do we have any benchmarks?

Looks good to me, though I'm a bit rusty now on some of the code involved so I may not spot problems.

I'm going to run some benchmarks before I commit.

thomie edited edge metadata.Nov 9 2014, 10:51 AM
thomie updated the Trac tickets for this revision.
austin accepted this revision.Nov 18 2014, 9:48 PM
austin edited edge metadata.


This revision is now accepted and ready to land.Nov 18 2014, 9:48 PM
This revision was automatically updated to reflect the committed changes.