[darcs-users] darcs patch: refactor Slurpy to common up name compon... (and 9 more)

Ganesh Sittampalam ganesh at earth.li
Wed Oct 29 20:31:06 UTC 2008


Hi David,

OK, I've now benchmarked this work on the GHC repo in kowey's
zoo, and the overall picture suggests significant speedups (20% or
so) on most of the tests (get, pull, unpull, record, unrecord,
revert), with possible slowdowns in whatsnew and get-lazy of
about 10%.

The slowdowns are on quite small absolute times, and I don't have an
easy way of doing benchmarks on a quiescent machine. However overall
the picture seems pretty positive, and therefore I'd like to submit
these for inclusion now.

To reiterate what I said before about the patches:

The work is motivated by issue711, where darcs whatsnew -ls is
slow on a large tree. A simple experiment with a directory
with a large number of files in it showed quadratic blowups
in the slurpy code, and in speedy_commute. Here I'm trying to
address the slurpy code. The basic idea is to switch over
from storing the files in a directory in a list, to using
Data.Map.

The potential downside of this is that Data.Map might be slower than a 
list for small directories. I think the benchmarking I describe above 
addresses that issue to a reasonable degree.

Patch-by-patch commentary:

This patch should leave behaviour unchanged, but exposes the
fact that both SlurpFile and SlurpDir specify a filename by
lifting it into a common place:

Sun Oct 26 12:37:22 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * refactor Slurpy to common up name component between File/Dir

This switches SlurpDir over to using a Data.Map. This means that
files will always be in lexicographic order in each directory.
It does things in a dumb way, just switching back to [Slurpy] in
any place that actually wants one.

Sun Oct 26 13:59:06 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * dumb changeover of SlurpDir contents from [] to Map


Some simple changes to actually make use of the fact that
we now have a Map:

Sun Oct 26 15:37:49 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * make use of the SlurpyDir Map in the obvious places

Sun Oct 26 18:55:18 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * bug fix

Sun Oct 26 19:27:15 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * another obvious use of the SlurpyMap

Sun Oct 26 20:04:42 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * simplify slurp_has_anycase


And some other cleanups to SlurpDirectory:

Minor:

Tue Oct 28 06:54:24 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * cleanup some patterns

Repository.HashedIO was the only module that used access to the 
internals of a Slurpy. This patch makes that explicit:

Tue Oct 28 07:29:11 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * clarify SlurpDirectory interface

Minor:

Tue Oct 28 18:53:58 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * a slight simplification

This one goes together with "clarify SlurpDirectory interface"

Wed Oct 29 19:07:15 GMT 2008  Ganesh Sittampalam <ganesh at earth.li>
  * fixup SRC_DIRS

Cheers,

Ganesh

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 119872 bytes
Desc: A darcs patch for your repository!
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20081029/c4ec096e/attachment-0001.bin 


More information about the darcs-users mailing list