Fuad Abdallah <[EMAIL PROTECTED]> writes:
> i have done some experiments with PackedString performance and would
> propose to extend PackedString with two functions like
>
> psTod::PackedString->Double
> and
> psToi::PackedString->Int
>
> just by using __ccall__ 's to atof and atoi.
> I have seen a 3 fold increase in speed compared with unpacking and running
> through the (very slow) haskell read function within a program that reads
> large ASCII files mainly consisting of ints and doubles (Protein Databank
> files)
Can you quantify how much of the speed difference is due to the lack
of unpacking, and how much to the use of atof instead of read?
The reason being, I'm interested in getting a library of functions
like these, for some report generation stuff I'm doing, but it would
be nice if the library had a String interface (possibly in addition to
a PackedString interface).
So far I've got a simple Haskell interface to printf for printing
Floats in a variety of formats, which is sadly lacking in Haskell.
Cheers,
Simon
--
Simon Marlow [EMAIL PROTECTED]
University of Glasgow http://www.dcs.gla.ac.uk/~simonm/
finger for PGP public key