Hi,

i have compared a C++ implementation with a Haskell implementation of the Monte 
Carlo Pi approximation:

http://lennart.kudling.de/haskellPi/

The Haskell version is 100 times slower and i wonder whether i do something 
obvious wrong.

Profiling says that the majority of the time is spend in "main". But i have no 
idea where.

Can someone give me a hint?

Thanks,
Lenny

                                                               individual    
inherited
COST CENTRE              MODULE                                               
no.    entries  %time %alloc   %time %alloc

MAIN                     MAIN                                                   
1           0   0.0    0.0   100.0  100.0
 main                    Main                                                 
254           1  88.1   90.8   100.0  100.0
  monteCarloPi           Main                                                 
255           1   0.6    1.1    11.9    9.2
   pairs                 Main                                                 
257    10000000   0.7    1.4     0.7    1.4
   countHits             Main                                                 
256    10000001   4.2    2.9    10.6    6.7
    accumulateHit        Main                                                 
258    27852236   3.0    2.3     6.4    3.8
     isInCircle          Main                                                 
259    30000000   3.3    1.5     3.3    1.5
 CAF:lit_r1A7            Main                                                 
248           1   0.0    0.0     0.0    0.0
  isInCircle             Main                                                 
260           0   0.0    0.0     0.0    0.0
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to