Re: [Haskell-cafe] haskell version of fractal benchmark

2007-06-09 Thread Scott Cruzen
* 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

2007-06-09 Thread Donald Bruce Stewart
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

2007-06-08 Thread 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?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] haskell version of fractal benchmark

2007-06-08 Thread Bayley, Alistair
 [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

2007-06-08 Thread Donald Bruce Stewart
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

2007-06-08 Thread Bayley, Alistair
 [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

2007-06-08 Thread Donald Bruce Stewart
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

2007-06-08 Thread Andrew Coppin




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

2007-06-08 Thread Simon Peyton-Jones
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

2007-06-07 Thread Donald Bruce Stewart
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=mandelbrotlang=ghcid=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