git-annex/Git
Joey Hess b76dc2d210 avoid space leak writing merge
This reduces the memory use of a merge by 1/3rd. The space leak was
apparently because the whole update-index input was generated strictly, not
lazily.

I wondered if the change to ByteStrings contributed to this, due to the
need to convert with L.pack here. But going back to the old code, I still
see a much similar leak, and worse performance besides due to it not using
ByteStrings.

The fix is to just hPutStr the lines repeatedly. (Note the \0 is written
separately, to avoid allocation overheads in adding it to the string.)
The Git.pipeWrite interface is probably just wrong for any large inputs to
git. This was the only place using it for input of any size.

There is still at least one other space leak in the merge code.
2011-11-15 22:19:12 -04:00
..
CatFile.hs Optimised union merging; now only runs git cat-file once. 2011-11-12 17:45:12 -04:00
LsFiles.hs lint 2011-11-11 01:52:58 -04:00
LsTree.hs reorder repo parameters last 2011-11-08 16:27:20 -04:00
Queue.hs reorder repo parameters last 2011-11-08 16:27:20 -04:00
UnionMerge.hs avoid space leak writing merge 2011-11-15 22:19:12 -04:00