[darcs-devel] vc-darcs.el efficiency issues [was: GNU Emacs...]

Kannan Goundan cakoose at yahoo.com
Thu Jul 7 11:19:46 PDT 2005


--- David Roundy wrote:
> I think there's some pruning code added to diff (by I've forgotten
> who) which might help here.  It won't avoid the redundant stats, 
> but would at least avoid comparing files that we don't care about, 
> which might be the real problem.  The stats actually go pretty 
> quickly now, but if there are many (large?) modified files, that 
> could make the smart_diff pretty slow.

I had written some functions to prune Slurpy trees to speed up "darcs
diff".  "diff" used to copy the pristine and working trees by
slurping them into Slurpy trees and writing them out again.  I
changed it so that the Slurpy trees were pruned before they were
written out.

   filter = create_tree_filter path_list
   t  = read_slurpy src_path
   t' = prune_slurpy filter t
   write_slurpy dest_path t

That code has since been replaced.  The new version uses a function
called "clonePaths" copy only the required files from one directory
tree to another (without operating on Slurpy trees).  This is more
efficient because we don't have to build up a full Slurpy tree in the
first place (unnecessary calls to stat(...)).
   
   clonePaths src_path dest_path path_list

I don't know how "whatsnew" is implemented but I'm guessing that
clonePaths wont be flexible enough.  The old functions have been
removed from SlurpDirectory.lhs so you'll have to get them from the
patches (see below).

BTW, if we do resurrect the old pruning code, it might be a good idea
to fix up so that it can match clonePaths' efficiency for the "darcs
diff" case.  To do this, I think we'd need to push the filtering into
the code that reads the directory tree.

   filter = create_tree_filter path_list
   t  = read_and_prune_slurpy filter src_path
   write_slurpy dest_path t

Now that I think about it, isn't this the kind of thing that
Haskell's laziness should do automatically?  Wait...that's only if
"read_slurpy" uses unsafe I/O, huh?  Anybody know?

- Kannan

-- Old Code --

Sun Mar  6 13:38:42 Pacific Standard Time 2005  Kannan Goundan
<kannan at cakoose.com>
  * Stylistic changes to Slurpy-pruning code (David's suggestions).

Wed Mar  2 20:28:27 Pacific Standard Time 2005  kannan at cakoose.com
  * When creating replicas to run "diff" on, only copy what's
necessary.

Wed Mar  2 20:26:06 Pacific Standard Time 2005  kannan at cakoose.com
  * Added functions to selectively prune a Slurpy tree.

-- New Code --

Fri May 13 11:47:02 Pacific Daylight Time 2005  Ian Lynagh
<igloo at earth.li>
  * Remove slurpy writing from Diff




		
____________________________________________________
Sell on Yahoo! Auctions – no fees. Bid on great items.  
http://auctions.yahoo.com/




More information about the darcs-devel mailing list