[Haskell-beginners] profiling a program that writes midi events
edwards.benj at gmail.com
Tue Apr 17 18:38:22 CEST 2012
Consider the criterion package + the modifications you suggested. Criterion
comes with useful functions for ensuring that you evaluate expressions
On 16 April 2012 15:47, Dennis Raddle <dennis.raddle at gmail.com> wrote:
> I want to profile a program, but it's not the usual kind of "run once, it
> completes" program. It computes a bunch of midi events and writes them to a
> MIDI port via the Sound.PortMidi module. It waits between events so that
> each one happens in the proper place in the music. And the program must not
> exit while it is writing events.
> When I run it, it takes about ten seconds until the music starts, so it
> must be doing most of the computation then. But it takes several minutes as
> it plays music.
> How would I profile this kind of program?
> One possibility is to modify it a bit so it computes all the midi events
> but doesn't send them, and just exits. However, I have to make sure it
> actually computes the events all the way (due to language laziness). If I
> don't write the events to PortMidi, then they are never used. I'm not sure
> on how to ensure an expression is completely evaluated if it never used.
> Beginners mailing list
> Beginners at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners