Hello,

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.

This took me to DarcsRepo.write_patch which led me to PatchShow.writePatch. Am I correct in assuming the reason the patch is reread is because the FilePath for the patch gets updated when the patch is written? If that is the case, I think we can modify Repository.writePatch to just update the patch's metadata and return that instead of rereading the patch.

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.

Should I send in the changes I have now, or do I need to update some detail of the freshly written patch in Repository.writePatch?

Thanks,
Jason

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

Reply via email to