
Hello Sebastian, Sunday, February 22, 2009, 2:55:38 AM, you wrote:
yes, you are right. Don also compared results of 64x-reduced computation with full one. are you think that these results are more fair?
Yes. Clearly so. It still computes the result from scratch - it just uses a trick which generates better code. This is clearly a useful and worthwhile exercise as it shows A) A neat trick with TH, B) A reasonably practical way to produce fast code for the critical parts of a Haskell app, C) a motivating example for implementing a compiler optimization to do it automatically.
yes, but does you know why his last program is 64x faster than simple code? it's because *gcc* optimize it this way. the first program i published there does it by mistake, then i fixed it by using 'xor' instead of (+) and published here that i've considered most fair comparison OTOH Don used this gcc optimization to generate faster code for haskell. he doesn't used this trick for C++ and doesn't omitted unoptimized gcc results from the chart. as a result people who don't analyzed details made conclusion that ghc outperformed gcc here so i have made experiment with cheating the same way, but in more obvious manner. and i got 3 angry answers in 5 minutes. so what are the difference? you don't catched details of Don comparison or you bothered only by gcc-related cheating? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com