[Haskell-cafe] Trace parser

Lemmih lemmih at gmail.com
Fri Jul 7 14:30:53 EDT 2006


On 7/6/06, Andy Georges <andy.georges at elis.ugent.be> wrote:
> Hello,
>
> I'm looking for a bit of help (ok, a lot) the speed up my program
> which I use to build a calltree out of an annotated program execution
> trace. To give you an idea about the sluggishness at the moment, for
> a trace containing 70MB, it has been running for about 10 hours
> straight (AMD Athlon XP (Barton) 2600+).
>
> The trace contains lines made up of a number of fields:
>
> C 4 1000 1000000
> C 4 1001 1000200
> R 4 1001 1003045
> R 4 1000 1003060
>
> C indicates a function entrypoint (call), R indicates a function
> exitpoint (return). The second field indicates which thread is
> executing the function, the third field denotes the function id, the
> last field contains a performance counter value. As you can see,
> numbering each line with a pre-order and a post-order number yields a
> list that can be transformed easily into a tree, which can then be
> manipulated. The first goal is to build the tree. This is done in the
> following code:
[snip]
> Any suggestions for improving this code?

Have you tried profiling the code?
You can find a guide to profiling with GHC here:
http://www.haskell.org/ghc/docs/latest/html/users_guide/profiling.html

-- 
Friendly,
  Lemmih


More information about the Haskell-Cafe mailing list