[Haskell-cafe] Re: Haskell Speed

Paul Moore p.f.moore at gmail.com
Mon Dec 26 16:01:38 EST 2005


On 12/26/05, Branimir Maksimovic <bmaxa at hotmail.com> wrote:
> Paul Moore wrote:
> > Dunno. It's certainly not a bad (executable!) definition of the
> > problem. My point is that Haskell allows me to write *very* clear
> > "executable pseudocode", but that code is not a good starting point
> > for writing production-quality code.
>
> this program counts two times length of lists of strings formed by
> lines, and words and third time counts again length of file.
> This is not just word counting program, it creates two additional lists,
> which are not used anywhere but to count :)
> While it is certainly expressive, in terms of programing is pointless.
> No one would write such a code for word counting.
>
> Here is what I would write in Haskell, same logic as in C++
> (i don;t know standard lib ):

Yes, that is a very reasonable way of improving performance. The
original algorithm, as you say, does 3 passes through the file, and
this does one, computing the 3 values "in parallel". So it does seem a
sensible next step. I must try timings to see how much this improves
the timings, and how much further there is to go :-)

Thanks,
Paul.


More information about the Haskell-Cafe mailing list