[darcs-devel] Use System.Directory.copyFile for file copying

Jason Dagit dagit at codersbase.com
Thu Jul 19 08:22:32 PDT 2007


On 7/18/07, Kevin Quick <quick at sparq.org> wrote:
> Presumably it's faster to let the System.Directory.copyFile perform
> the file copying than working through the PackedString and the IO monad.
> My testing didn't show any real timing difference, but it may have less
> effect on memory/GC issues and just seems like the right thing to do...

I'm trying to understand why System.Directory.copyFile would be
preferred.  Isn't it implemented in Haskell too?  Isn't bytestring (or
rather PackedString) IO heavily optimized and on par with C?

I did a quick google for the file that defines copyFile and I found an
old copy in the fptools cvs that makes me think it is implemented in
Haskell:
http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/base/System/Directory.hs?rev=1.59;content-type=text%2Fplain

Kevin, have you tried a benchmark with a, say, 256mb file (or bigger)?
 What was your timing example?  Did you try to measure memory
consumption at all?  Can you provide any evidence that one uses more
or less memory than the other?

Thanks,
Jason


More information about the darcs-devel mailing list