[darcs-devel] darcs patch: Implement gzReadFile (and 19 more)

David Roundy droundy at abridgegame.org
Tue Apr 19 04:44:28 PDT 2005


On Tue, Apr 19, 2005 at 12:18:05AM +0100, Ian Lynagh wrote:
> On Sat, Apr 16, 2005 at 06:14:31PM -0400, David Roundy wrote:
> > Thanks, Ian!
> > 
> > On Sat, Apr 16, 2005 at 04:31:39PM -0400, Ian Lynagh wrote:
> > > 
> > > Some graphs and whatnot here:
> > > http://urchin.earth.li/~ian/darcs/res/res.html
> > 
> > I get bad timing results, and for some reason I don't get nearly as nice
> > results on the memory usage as what your profiling suggests.
> > 
> > Your latest patchset:
> > 
> > $ time ../darcs_ian record -a -m foo -l
> > real    11m59.270s
> > user    11m9.980s
> > sys     0m40.010s
> > 
> > (Took 492m memory)
> 
> I'm not using -l, which might explain it, although just trying it it
> doesn't seem to make much difference.
> 
> I also have the pull_firsts_middles hack, which you presumably don't?
> (sorry, should have mentioned that given it was in a mail without it)

Okay, that makes sense.  And also helps a lot to explain the "why" of the
pull_firsts_middles hack.  I may be remembering wrongly, but can't we get
the same benefit (in this case) by special-casing the situation where All
`elem` opts and there are no files specified on the command line in Select?
i.e. when other_ps is known to be []...

> > > [Tweak Diff.lhs
> > > Ian Lynagh <igloo at earth.li>**20050415231250] {
> > 
> > It looks here like this is just a cleanup, switching to return a list
> > rather than a Maybe list.  Is there more to it than that? I suspect
> > there is a deep laziness reason that I haven't seen...
> 
> It's mostly to allow the later changes, but I think it also avoided some
> unnecessary joining and flattening of patches. It also removed the
> reorder_and_coalesce which seemed redundant given the other sorting.

Hmmm.  I seem to recall that the reorder_and_coalesce may be necesary.  I'm
not sure it's necesary *here* but there are situations where we've got a
whole bunch of file adds followed by a whole bunch of hunk patches,
followed by a whole bunch of file removals, and it's all equivalent to the
null patch... but I guess in smart_diff itself, that'll never happen.  It's
only when working with pending, which you haven't modified (as far as I can
see).

> > > [Don't sort directory contents
> > > Ian Lynagh <igloo at earth.li>**20050416030619] {
> > > hunk ./SlurpDirectory.lhs 57
> > > - -import List ( sort, tails, isPrefixOf )
> > > +import List ( tails, isPrefixOf )
> > > hunk ./SlurpDirectory.lhs 232
> > > - -get_dircontents (SlurpDir _ _ c) = sort c
> > > +get_dircontents (SlurpDir _ _ c) = c
> > > }
> > 
> > I'm concerned here...  Don't we assume that the directories are sorted in
> > recur_diff?
> 
> Hmm, you are right, for the full generality we need to sort. Pity, it
> takes my times from 1.3s to 2s  :-(

Do you know how the sort of an ordered list behaves? One could use a sort
algorithm that is O(N) when applied to a presorted list, which might help.

> We might be better off building sorted slurpies when we need them. Then
> whatsnew wouldn't need to bother. Hmm, except we still need to cope with
> files missing in the co slurpy.

Indeed, it seems to me that if where were an appropriately lazy sort of
FiniteMap (or Data.Map, or whatever), then that would really be ideal.

> > Also, I'm not quite sure why you return without failure when the directory
> > we're trying to create already exists, but is a symbolic link, provided it
> > is "."... what does that mean?  How can "." be a symbolic link?
> 
> I don't know, but it was memory of the comment here that made me do the
> above:

Okay, it's starting to come back to me.  There was a time when you couldn't
(on some system) cd into a symlink to your repository and then run darcs,
since darcs would claim that the current directory doesn't exist.  I
believe it has to do with what path is returned by getCurrentDirectory--on
some systems I believe it includes the symlink in that path (if you had
previously run cd /symlink_to_repo), even though that's weird.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list