Make clearNursery free
ClosedPublic

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

Details

Summary

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

validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
simonmar retitled this revision from to Make clearNursery free.Oct 7 2014, 5:21 AM
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

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

I think this solves https://ghc.haskell.org/trac/ghc/ticket/9067#

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

fix a bug

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

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 updated the Trac tickets for this revision.Nov 9 2014, 10:51 AM
austin accepted this revision.Nov 18 2014, 9:48 PM

LGTM.

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.