brian bri...@aracnet.com writes:
However, I would like to reiterate that it's the double - string
which is really the time/memory sink. I verified this by printing a
simple string based on the value (to make sure the value was
evaluated) and it runs fast enough for me.
Is there an
Still, a fast and general way to output primitive data types would be
quite welcome.
Naive question: Can't we just ask C to do it for us? (With a foreign
function call.)
Matthias.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
matthias.goergens:
Still, a fast and general way to output primitive data types would be
quite welcome.
Data.Binary is the way (though it doesn't yet use direct output for
float and double bits)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
briand:
I have included a new and improved version.
Just to make the comparison a little more reasonable I re-wrote the
program using ML and ran it with SMLNJ
eal 0m3.175s
user 0m0.935s
sys 0m0.319s
Here's the compiled haskell (ghc -O2 foo.hs -o foo):
real 0m16.855s
user
On Jun 16, 2009, at 8:58 AM, Don Stewart wrote:
So I guess it's the show's, but I can't seem to find more efficient
float output.
FFI to sprintf ? yuch.
Is your SMLNJ using lazy lists? :)
strictly speaking : no.
Try hmatrix or uvector.
uvector is _probably_ the long term answer even
On Tue, Jun 16, 2009 at 6:47 PM, brian bri...@aracnet.com wrote:
On Jun 16, 2009, at 8:58 AM, Don Stewart wrote:
So I guess it's the show's, but I can't seem to find more efficient
float output.
FFI to sprintf ? yuch.
Is your SMLNJ using lazy lists? :)
strictly speaking : no.
Try
How much output does this generate? Does it matter if you send the
output to /dev/null? This looks as if the bottleneck might well be in
I/O operations, not in the code itself. To find this out, you could
rewrite the code in C and see if that makes a difference?
Thomas
On Sun, Jun 14, 2009 at
I have included a new and improved version.
Just to make the comparison a little more reasonable I re-wrote the
program using ML and ran it with SMLNJ
eal 0m3.175s
user0m0.935s
sys 0m0.319s
Here's the compiled haskell (ghc -O2 foo.hs -o foo):
real0m16.855s
user0m9.724s
Haskell Gurus,
I have tried to use profiling to tell me what's going on here, but it
hasn't helped much, probably because I'm not interpreting the results
correctly.
Empirically I have determined that the show's are pretty slow, so an
alternative to them would be helpful. I replaced the