[Haskell-cafe] cost of modules

Fawzi Mohamed fmohamed at mac.com
Tue Mar 27 19:51:33 EDT 2007


Thanks !

Il giorno Mar 28, 2007, alle ore 12:04 AM, Tim Chevalier ha scritto:

> On 3/27/07, Jeremy Shaw <jeremy.shaw at linspireinc.com> wrote:
>> At Tue, 27 Mar 2007 23:10:21 +0200,
>> Fawzi Mohamed wrote:
>>
>> > If someone has an idea on how else I can improve timings please  
>> tell me.
>>
>> I believe you are seeing a speed decrease, because GHC is not  
>> inlining
>> functions as much when you split them into modules. If you add
>> explicit inline statements, I think you should be able to get back to
>> your original timings.
>>
>
> It could be inlining or it could be other optimizations. From the data
> the OP gives, I don't think it's possible to conclude which ones.

I did longer runs (all compiled with -O2 as before) with the same  
results.
and indeed with a couple of {-# INLINE function #-} I was able to  
recover the previous performance and actually even get a better  
performace than before.

Thanks!

An interesting thing is that the profiler actully was saying that the  
non inlined version (and for the matter also the the split version)  
were faster than the inlined or single module versions.
It would seem that the profiling ovehead for the inlined functions  
are not correctly accounted for, so that they appear as more  
expensive than the plain version when profiling.

Fawzi


More information about the Haskell-Cafe mailing list