Performance

This is a new page to discuss the performance of Darcs. It will focus on specific cases were darcs has known to be slower-than-ideal, and suggestions for improvement. See also StandardDarcsBenchmarks

Slow performance cases

Testing Linux kernel work

Catalin reports on the mailing list: Unfortunately, I cannot use it with the Linux kernel (that's what I mainly do) because it is very slow (3 hours for a big patch merging) and uses a lot of memory (over 600MB).

The author suggests: You could either make more memory available for darcs, or compile darcs with the --enable-antimemoize option. The initial record is the command which most stresses darcs' memory, as it requires holding the entire tree in parsed and in memory.

The linux kernel probably requires close to a gigabyte of memory. I'm not sure how much it will take with --enable-antimemoize.

)

--enable-antimemoize, a possible solution to help the kernel case

This is a darcs compile time option. The author explains:

(Kevin Ollivier reported that -enable-antimemoize helped with his performance issues

> The antimemoize appears to have been removed between darcs 1.0.2 and darcs 1.0.5, with nary a changelog entry. I use darcs for some pretty large projects, and I was hoping this would help. What's going on? --JasonFelice

--look-for-adds slow in some cases

using --look-for-adds was reported to be slower than it should be in one case.

darcs diff

Up to 1.0.2, darcs was unnecessarily slow when computing a diff between a limited number of files in the working directory and the most recent copy in the repo. In 1.0.3 and beyond, a patch has been added to optimize this case.

If you just want to compare what changes you've made since the last record you made, this workaround may give the same result and be very fast:

   diff _darcs/current/file.txt file.txt

The Emacs vc-darcs.el and the darcs.vim Vim plug-in both use this shortcut to provide better performance here. See the Front Page for details about those plug-ins.

Also, 'darcs whatsnew file.txt' will give a similar result.

darcs pull

'pull' can get slow when pulling from a remote repo with a long patch history to read (mostly because the network layer is unable to pipeline requests for remote files). You can work around this issue by checkpointing the remote repo (darcs optimize --checkpoint), and using get --partial.

Of related interest: if you're pulling over HTTP, you should know that Darcs will operate properly over a caching HTTP proxy (especially if it supports HTTP/1.1 Cache-Control directives). This might save you a lot of time if you're repeatedly pulling from the same remote repo.

Comments and Questions

Has anyone considered trying the arrow interface for patch operations? I haven't stared at Patch.lhs in enough detail to see whether that idea has obvious flaws, but arrows might allow statically available properties to be cached during multiple patch operations --ShaeErisson

See also

DarcsWiki: Performance (last edited 2008-08-16 12:24:20 by EricKow)