Re: [Haskell-cafe] haskell version of fractal benchmark
dons: > sic: > > * Andrew Coppin <[EMAIL PROTECTED]> [070608 02:45]: > > >Bayley, Alistair wrote: > > > > > > [[1]mailto:[EMAIL PROTECTED] On Behalf Of Andrew Coppin > > > > > > Donald Bruce Stewart wrote: > > > > > > Some things to remember using Doubles: > > > > > > * {-# OPTIONS -fexcess-precision #-} > > > * -fvia-C > > > * -fbang-patterns > > > * -optc-O2 -optc-mfpmath=sse -optc-msse2 > > > * -optc-march=pentium4 > > > > > > 1. What do all those things do? > > > 2. Is the effect actually that large? > > > > > > Large? Depends what you mean by large, but adding a few flags to get > > > just a 10-20% speedup isn't to be ignored: > > > > > >Sure - if it really is 10-20%. (And not, say, 0.001 - 0.002%.) > > > > A single data point for all of this, I have a program that calculates: > > > > P^1_i = S_i/sum_k S_k > > P^m_i = sum_{k!=i} P^1_k*P^m-1_i(S_~k) > > > > Here's timings for the different options: > > > > options run timecompile time > > none 46.401 3.136 > > -O 5.033 4.906 > > -O24.967 6.755 > > -O2 -fexcess-precision 3.710 6.396 > > all listed options 3.602 6.344 My apologies. Misread that last line. /me drinks more tea. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell version of fractal benchmark
sic: > * Andrew Coppin <[EMAIL PROTECTED]> [070608 02:45]: > >Bayley, Alistair wrote: > > > > [[1]mailto:[EMAIL PROTECTED] On Behalf Of Andrew Coppin > > > > Donald Bruce Stewart wrote: > > > > Some things to remember using Doubles: > > > > * {-# OPTIONS -fexcess-precision #-} > > * -fvia-C > > * -fbang-patterns > > * -optc-O2 -optc-mfpmath=sse -optc-msse2 > > * -optc-march=pentium4 > > > > 1. What do all those things do? > > 2. Is the effect actually that large? > > > > Large? Depends what you mean by large, but adding a few flags to get > > just a 10-20% speedup isn't to be ignored: > > > >Sure - if it really is 10-20%. (And not, say, 0.001 - 0.002%.) > > A single data point for all of this, I have a program that calculates: > > P^1_i = S_i/sum_k S_k > P^m_i = sum_{k!=i} P^1_k*P^m-1_i(S_~k) > > Here's timings for the different options: > > options run timecompile time > none 46.401 3.136 > -O 5.033 4.906 > -O24.967 6.755 > -O2 -fexcess-precision 3.710 6.396 > all listed options 3.602 6.344 > Due to a (now fixed in 6.6.1 I think) bug in GHC 6.6, -fexcess-precision *must* be inserted in a pragma. Did you do that? {-# OPTIONS -fexcess-precision #-} See the bug report here, http://hackage.haskell.org/trac/ghc/ticket/1138 -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell version of fractal benchmark
* Andrew Coppin <[EMAIL PROTECTED]> [070608 02:45]: >Bayley, Alistair wrote: > > [[1]mailto:[EMAIL PROTECTED] On Behalf Of Andrew Coppin > > Donald Bruce Stewart wrote: > > Some things to remember using Doubles: > > * {-# OPTIONS -fexcess-precision #-} > * -fvia-C > * -fbang-patterns > * -optc-O2 -optc-mfpmath=sse -optc-msse2 > * -optc-march=pentium4 > > 1. What do all those things do? > 2. Is the effect actually that large? > > Large? Depends what you mean by large, but adding a few flags to get > just a 10-20% speedup isn't to be ignored: > >Sure - if it really is 10-20%. (And not, say, 0.001 - 0.002%.) A single data point for all of this, I have a program that calculates: P^1_i = S_i/sum_k S_k P^m_i = sum_{k!=i} P^1_k*P^m-1_i(S_~k) Here's timings for the different options: options run timecompile time none 46.401 3.136 -O 5.033 4.906 -O24.967 6.755 -O2 -fexcess-precision 3.710 6.396 all listed options 3.602 6.344 Results with -fexcess-precision are very insignificantly different (1.0 e-7). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] haskell version of fractal benchmark
3) -fbang-patterns Better than `seq` Do you mean "more convenient than" or "generates better code than". I don't think the latter should be true; send a counterexample if you find one! Simon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell version of fractal benchmark
Bayley, Alistair wrote: [mailto:[EMAIL PROTECTED]] On Behalf Of Andrew Coppin Donald Bruce Stewart wrote: Some things to remember using Doubles: * {-# OPTIONS -fexcess-precision #-} * -fvia-C * -fbang-patterns * -optc-O2 -optc-mfpmath=sse -optc-msse2 * -optc-march=pentium4 1. What do all those things do? 2. Is the effect actually that large? Large? Depends what you mean by large, but adding a few flags to get just a 10-20% speedup isn't to be ignored: Sure - if it really is 10-20%. (And not, say, 0.001 - 0.002%.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell version of fractal benchmark
Alistair_Bayley: > > [mailto:[EMAIL PROTECTED] On Behalf Of Donald > > Bruce Stewart > > > > 3) -fbang-patterns > > > > Better than `seq` > > Better in the "more convenient to write" sense, right? AFAIUI, seq and > bang patterns should be equivalent. > Yes, in the 'more convenient' sense. Adding strictness speculatively, while trying to debug a leak, is easier when inserting !, than to insert `seq`'s. It also doesn't obfuscate the code as much as the seq tricks do. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] haskell version of fractal benchmark
> [mailto:[EMAIL PROTECTED] On Behalf Of Donald > Bruce Stewart > > 3) -fbang-patterns > > Better than `seq` Better in the "more convenient to write" sense, right? AFAIUI, seq and bang patterns should be equivalent. Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell version of fractal benchmark
andrewcoppin: > Donald Bruce Stewart wrote: > >Some things to remember using Doubles: > > > >* {-# OPTIONS -fexcess-precision #-} > >* -fvia-C > >* -fbang-patterns > >* -optc-O2 -optc-mfpmath=sse -optc-msse2 > >* -optc-march=pentium4 > > > > 1. What do all those things do? Check the GHC user's guide. > 2. Is the effect actually that large? 1) {-# OPTIONS -fexcess-precision #- I've had this halved runtimes for runtimes for numeric-intensive programs. 2) -fvia-C Probably still worth 10% for Double-based stuff (maybe more). 3) -fbang-patterns Better than `seq` 4) -optc-O2 -optc-mfpmath=sse -optc-msse2 -optc-march=pentium4 Can be worth 0 to hmm, quite a few, percent, depending on the code. This is all assuming you've written low level code anyway, so that the effects of, say, using SSE instructions are actually apparent. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] haskell version of fractal benchmark
> [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Coppin > > Donald Bruce Stewart wrote: > > Some things to remember using Doubles: > > > > * {-# OPTIONS -fexcess-precision #-} > > * -fvia-C > > * -fbang-patterns > > * -optc-O2 -optc-mfpmath=sse -optc-msse2 > > * -optc-march=pentium4 > > 1. What do all those things do? > 2. Is the effect actually that large? Large? Depends what you mean by large, but adding a few flags to get just a 10-20% speedup isn't to be ignored: http://www.haskell.org/haskellwiki/Performance/GHC#Crank_up_the_gcc_flag s http://www.haskell.org/haskellwiki/Performance/Floating_Point Alistair * Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell version of fractal benchmark
Donald Bruce Stewart wrote: Some things to remember using Doubles: * {-# OPTIONS -fexcess-precision #-} * -fvia-C * -fbang-patterns * -optc-O2 -optc-mfpmath=sse -optc-msse2 * -optc-march=pentium4 1. What do all those things do? 2. Is the effect actually that large? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell version of fractal benchmark
clawsie: > i recently saw a (yet-another) benchark comparing various languages: > > http://www.timestretch.com/FractalBenchmark.html > > while no haskell example was listed, i thought i would try a naive > implementation myself for comparison. it is available here: > > http://www.b7j0c.org/dev/haskell/misc/time.hs > > my timing of the compiled code was slightly under three seconds over a > few tests, landing sort of where i would expect a naive haskell > implementation to place. i am sure people here could greatly improve > my attempt. it may be that my solution is not even correct. There's also a mandelbrot generator on the shootout, http://shootout.alioth.debian.org/gp4/benchmark.php?test=mandelbrot&lang=ghc&id=4 Some things to remember using Doubles: * {-# OPTIONS -fexcess-precision #-} * -fvia-C * -fbang-patterns * -optc-O2 -optc-mfpmath=sse -optc-msse2 * -optc-march=pentium4 -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe