On Jan 14, 2006, at 6:13 AM, Ian Lynagh wrote:

On Sat, Jan 14, 2006 at 04:24:16AM -0800, Jason Dagit wrote:

I was looking a issue80 and I discovered that Repository.writePatch
reads the freshly written patch.  This is a very expensive operation
given the current patch format.  So I started to wonder why it does
that.

To avoid the data all being kept in memory.

As an experiment I removed the reading the patch and just let
Repository.writePatch return the same patch it was given.  On a test
case of recording a 37meg file I went from 39 seconds for the record
to just 3.9 seconds.  Total memory allocated during the run when from
3.5 gigs to 444 megs.  This is a very significant savings.

The peak memory usage is far more important.
"darcs record -a" ought to be a constant space operation.

I'll go double check this but I've seen no evidence of this with the current implementation. For me it would appear that darcs uses a ton of memory on large files, and issue80 speaks directly to this as a problem.


As you imply, the 39s vs 3.9s ratio is likely to reduce when we use the
new patch format, so it seems premature to optimise for it.

Well, given the speed increase, why don't we optimize it for now and then when the new patch format is in we can remove this "optimization"?

If not this is a patch I'll be maintaining for myself in the versions of darcs I use due to the huge performance gain that I'm seeing.

Thanks,
Jason

_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to