[darcs-devel] Removing dirty flag from Slurpy?

Ian Lynagh igloo at earth.li
Mon May 2 07:48:02 PDT 2005


On Sun, May 01, 2005 at 08:43:21AM -0400, David Roundy wrote:
> Darcs developers (especially Ian and Juliusz),
> 
> What do you think of the possibility of getting rid of the dirty flag in
> SlurpFile and the (IO ()) in SlurpDir, and the whole write_dirty business?

I'm not sure about that.

When applying a single patch I'm sure it'll be best to just do it direct
to the on-disk files, but when pulling or getting a number of patches
there's a tradeoff between doing more IO than is necessary and using
more memory than is necessary. Someone on IRC has said a darcs get of
darcs to an SMB mount was horrendously slow.

Currently we choose which one is used when, but in principle we could
allow the user to override us with commandline flags. We could either
always default to the IO-heavy way (which is the "safe" way) or stick
with an ad-hoc decision. I think always-IO-heavy would be the better of
the two so it's consistent.

Actually, perhaps a better way would be to have a function that
can merge a list of patches into a single patch that can then just be
applied? This way we'd still be able to get rid of all the dirty slurpy
code, and this flag now just does

    mapM_ apply (if high_mem then [merge_patches ps] else ps)

rather than being an entirely new codepath for bugs and inconsistencies
to appear in.


Thanks
Ian





More information about the darcs-devel mailing list