7 Oct 05:54
Re: newbie questions (read, etc., with Data.ByteString.Lazy.Char8)
wman <666wman <at> gmail.com>
2008-10-07 03:54:44 GMT
2008-10-07 03:54:44 GMT
just for the kicks i tried the new version of bytestring without -O2 and the results were even worse:
time Main1 < nums
real 0m40.092s
user 0m0.015s
sys 0m0.015s
time Main3 < nums
real 0m41.405s
user 0m0.015s
sys 0m0.015s
it got pwned even by this very naive ruby scipt (which, btw, chewed through some ~600 MB of memory
)
File.open("nums","r") do |f|
puts((f.read.split.each {|x| x.to_i }).length)
end
time ruby nums.rb
real 0m21.609s
user 0m0.015s
sys 0m0.015s
so it probably can't be stressed enough: repeat "-O2"
and now seriously:
is there a reason why -O2 shouldn't be made the default (and allowing to turn off optimizations by -O0 perhaps) ?
time Main1 < nums
real 0m40.092s
user 0m0.015s
sys 0m0.015s
time Main3 < nums
real 0m41.405s
user 0m0.015s
sys 0m0.015s
it got pwned even by this very naive ruby scipt (which, btw, chewed through some ~600 MB of memory
)File.open("nums","r") do |f|
puts((f.read.split.each {|x| x.to_i }).length)
end
time ruby nums.rb
real 0m21.609s
user 0m0.015s
sys 0m0.015s
so it probably can't be stressed enough: repeat "-O2"
and now seriously:
is there a reason why -O2 shouldn't be made the default (and allowing to turn off optimizations by -O0 perhaps) ?
On Tue, Oct 7, 2008 at 5:36 AM, wman <666wman <at> gmail.com> wrote:
new figures, after updating bytestring (0.9.0.1.1 -> 0.9.1.2) && using -O2
time Main < nums
real 0m2.531stime Main2 < nums
user 0m0.015s
sys 0m0.015s
real 0m13.999stime Main3 < nums
user 0m0.015s
sys 0m0.015s
real 0m2.796sthats more like it, even the unpacking didn't hurt so much.
user 0m0.015s
sys 0m0.015s
the morals: "Thou shalt update your libraries" & "Thou shalt not forget to turn on optimizations" before bitching it's too slow))
thxOn Tue, Oct 7, 2008 at 5:19 AM, Don Stewart <dons <at> galois.com> wrote:Hmm. How are you compiling it? Using bytestring 0.9.1.x ?
Should be fast,
http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&lang=all
Assuming you're turning on optimisations ( ghc -O2 )
-- Don
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe <at> haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RSS Feed