[Template-haskell] Profiling with Template Haskell, again

Simon Marlow simonmar at microsoft.com
Mon Jul 11 07:53:48 EDT 2005


Also, you need to compile each module in the program twice: once
unprofiled, for running TH splices, and once profiled for the final
executable.

We'd probably need some new flags to GHC to handle this.  The TH linker
needs to know to link in the unprofiled object files, but the
compilation manager needs to generate profiled object files, so we need
two separate object suffices.  We already have -osuf, so perhaps we need
-th-osuf (and hence -th-hisuf).

But that's not all.  You could get into trouble if the .hi files
differed between the profiled and unprofiled versions of modules,
because GHC assumes they're the same.  I haven't thought through exactly
what could go wrong if they're different, but we're definitely on shaky
ground here.  Compiling without optimisation will probably be necessary,
but then that degrades the usefulness of profiling.

Cheers,
	Simon

On 11 July 2005 12:44, Simon Peyton-Jones wrote:

> Here's a Template Haskell problem.  When compiling with -prof, you
> want to link with *profiled* libraries for the final executable, but
> with *ordinary, unprofiled* libraries for the TH libs that are linked
> with GHC itself.
> 
> There is nothing truly hard about implementing this, but it's fiddly.
> This message has been sitting in my mailbox for more than two months,
> so I'm plainly not getting to it.  To unblock, would anyone like to
> volunteer to have a go?  I can tell you where to look.
> 
> Simon
> 
>> -----Original Message-----
>> From: template-haskell-bounces at haskell.org
> [mailto:template-haskell-bounces at haskell.org] On
>> Behalf Of Andre Pang
>> Sent: 25 April 2005 15:42
>> To: <template-haskell at haskell.org> <template-haskell at haskell.org>
>> Cc: Sean Seefried
>> Subject: [Template-haskell] Profiling with Template Haskell, again
>> 
>> Hi all,
>> 
>> I've run into the same problem as Sean Seefried, namely that I'd like
>> to profile executables built with Template Haskell:
>> 
>> 
>
http://www.haskell.org/pipermail/template-haskell/2003-July/000135.html
>> 
>> (Specifically, profiling the final executable, not the splicing.)
>> 
>> I guess this is just a simple message to say that there's someone
>> else asking for profiling support with TH now, in the hopes that
>> it'll bump up its priority on the ever-growing to-do list :).
>> 
>> Thanks,
>> 
>> 
>> --
>> % Andre Pang : trust.in.love.to.save  <http://www.algorithm.com.au/>
>> 
>> _______________________________________________
>> template-haskell mailing list
>> template-haskell at haskell.org
>> http://www.haskell.org/mailman/listinfo/template-haskell
> _______________________________________________
> template-haskell mailing list
> template-haskell at haskell.org
> http://www.haskell.org/mailman/listinfo/template-haskell



More information about the template-haskell mailing list