
On Sun, 2010-04-11 at 17:17 +0200, Daniel Fischer wrote:
I *guess* that in most cases the overhead on I/O will be
sufficiently
great to make the difference insignificant. However:
? which difference?
Try reading large files.
Well - while large files are not not-important IIRC most files are small (< 4 KiB) - at least on *nix file systems (at least that's the core 'idea' of reiserfs/reiser4 filesystems). I guess that for large strings something like text (I think I mentioned it) is better
Count the lines or something else, as long as it's simple. The speed difference between ByteString-IO and [Char]-IO is enormous. When you do something more complicated the difference in IO-speed may become insignificant.
Hmm. As newline is a single-byte character in most encodings it is believable. However what is the difference in counting chars (not bytes - chars)? I wouldn't be surprise is difference was smaller. Of course: - I haven't done any tests. I guessed (which I written) - It wasn't written what is the typical case - What is 'significant' difference Regards