[Haskell-beginners] Optimising a combinatorial algorithm?

Ozgur Akgun ozgurakgun at gmail.com
Thu Sep 24 20:11:05 UTC 2015


On 24 September 2015 at 15:11, Mario Lang <mlang at delysid.org> wrote:

> Profiling tells me I am spending 90% of all the time in 'dur', which is my
> small helper method to calculate the duration of a PartialVoice,
> PartialMeasure or Voice.
>

As a start, and to aid profiling, I suggest getting rid of the Duration
type class and giving explicit names to different dur functions. Which one
of the dur's is getting called most? How do they interact?

My hunch is that after you do this (something like) memoization to avoid
calculating the durations repeatedly will be needed.

Hope this helps,
Ozgur

PS: Cool problem! Do you have some input/output pairs available? If you can
share some, others can validate their attempts without too much domain
knowledge.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150924/0d172ec9/attachment.html>


More information about the Beginners mailing list