|
From: Donald Bruce Stewart <dons <at> cse.unsw.edu.au>
Subject: Re: ByteStrings and the ram barrier Newsgroups: gmane.comp.lang.haskell.libraries Date: 2006-05-14 01:24:18 GMT (3 years, 7 weeks, 4 days, 3 hours and 35 minutes ago) kahl: > > > > After tuning the chunk size to the cache size, the filter 'e' test now > > runs in: > > 4.52 minutes, 53% cpu. > > With respect to the original comparison, > Ryan Lortie pointed out that ``sed'' is an unfair comparison, > and ``tr'' would be more appropriate. Hi! Good idea, I always forget about tr. Here's the result: manzano$ time tr -d e < /home/dons/data/10G > /dev/null tr -d e < /home/dons/data/10G > /dev/null 26% cpu 4:34.55 total I'm happy with this, within 6% of C, for a one liner. The Haskell program is: > import System.IO > import Data.Char > import qualified Data.ByteString.Lazy as L > > main = L.hGetContents stdin >>= L.hPut stdout . L.filterNotByte e > where e = fromIntegral . ord $ 'e' -- Don |
|
|