fillmaster / fillMaster

FillMaster: A drum idea generator / improvisation trainer! - Open Source, always looking for more contributors :)
https://fillmaster.app/
GNU General Public License v3.0
31 stars 7 forks source link

Improved randomizer performance #43

Closed Loeffeldude closed 2 years ago

Loeffeldude commented 2 years ago

When I was testing the new randomizer on my phone yesterday the performance was very poor. I tracked it down to be the 'handleSetItem' function causing the slowdown. It was being called anytime a new value was flicked through which is, as far as I understand it, unnecessary because we only care about the last value. So I fixed that and it runs a lot smoother on phone or desktop.

I also simplified the logic by removing recursion which was elegant in the beginning but got cluttered pretty quick .

And finally I added some tests to make it more robust.

Loeffeldude commented 2 years ago

I just found a bug where the UI shows the wrong entry give me a moment to fix it