Tip for profiling GHC

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Tip for profiling GHC

Matthew Pickering
Hi all,

I thought for a long while that if you wanted to profile GHC itself
then you had to
build a profiled version of HEAD. However, this isn't true.

The easiest way to profile GHC itself is to write a simple GHC API
application and compile that
with profiling. Normal GHC distributions come with profiling versions
of the ghc library so you can use this to profile released versions of
the compiler.

For example, here is a simple program that Andreas created when I
suggested he did this.

https://gist.github.com/mpickering/e13f343f2b35b51693d15582180b1c02

You can specify whatever options you want to start the session, you
might imagine compiling a package with cabal and copying the command
line flags from there in order to set up a session correctly.

Cheers,

Matt
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs