2007/7/19, Jason Dagit <[EMAIL PROTECTED]>:
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?

Even if a performance comparison is the best thing to do, I think that
Kevin's observation is a good one.
If there's a standard library function to do X, unless there're good
reasons to not use it (e.g. compatibility with old library versions,
bad performance), it should be preferred to hand-made solutions.
If in GHC 6.x (or maybe y.x) they decide to improve it with a
super-fast-hardware-accelerated-sse-mmx-altivec-parallel algorithm, we
get the performance for free.

Anyway, in GHC 6.6.1, copyFile is implemented in Haskell with raw
buffered copy, using hGetBuf / hPutBuf.

For the same reason, I think that we should seriously think to switch
to ByteStrings. Isn't Darcs PackedString just a "prerelease" version
of ByteStrings? They have a pretty similar API. And now (in 6.7)
ByteStrings have a
super-fast-hardware-accelerated-sse-mmx-altivec-parallel algorithms
for stream fusion (more or less ;) ).

Salvatore
_______________________________________________
darcs-devel mailing list
darcs-devel@darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-devel

Reply via email to