<div dir="ltr"><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On 24 September 2015 at 15:11, Mario Lang <span dir="ltr"><<a href="mailto:mlang@delysid.org" target="_blank">mlang@delysid.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":4d9" class="a3s" style="overflow:hidden">Profiling tells me I am spending 90% of all the time in 'dur', which is my<br>
small helper method to calculate the duration of a PartialVoice,<br>
PartialMeasure or Voice.<br></div></blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra">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?</div><div class="gmail_extra"><br></div><div class="gmail_extra">My hunch is that after you do this (something like) memoization to avoid calculating the durations repeatedly will be needed.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Hope this helps,</div><div class="gmail_extra">Ozgur</div><div class="gmail_extra"><br></div><div class="gmail_extra">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.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div>
</div></div>