Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed interpolateNoteX to be a bit faster #3

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

DJLuna441
Copy link

It's about 15-20% faster than the old one.
The test was:

function DEBUG_RunTest(){
 let start = performance.now();
 for(let i = 0; i < 120; i+=0.000001){
  interpolateNoteX(i); //The Old One
 }
 let end = performace.now();
 let oldTime = end - start;
 start = performance.now();
 for(let i = 0; i < 120; i+=0.000001){
  newInterpolateNoteX(i); //The New One
 }
 end = performace.now();
 let newTime = end - start;
 console.log("New: " + newTime + " | Old: " + oldTime);
}

Under those (quite unrealistic imo) circumstances the new One is faster. In my oppinion the new implementation is not worth the performace gain since its quite unreadable now since math is not as overviewable than a lerp and a map.

Luna and others added 2 commits July 2, 2024 00:25
@DanielPXL DanielPXL merged commit 5753841 into DanielPXL:master Jul 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants