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

Magic number #1

Open
jonashaag opened this issue Jun 30, 2023 · 1 comment
Open

Magic number #1

jonashaag opened this issue Jun 30, 2023 · 1 comment

Comments

@jonashaag
Copy link
Contributor

jonashaag commented Jun 30, 2023

https://github.com/iver56/fast-align-audio/blob/main/fast_align_audio/_faa.c#L24

I just realized there is this magic number in the code. I think this is to balance the number of summations needed for the early exit vs. the gains from exiting early.

I don’t know why it’s this particular number. I wonder if we should benchmark this. Also using modulo 100 probably isn’t the most obvious thing; I’d expect something modulo base 2.

@jonashaag
Copy link
Contributor Author

Surprisingly it’s not too bad haha:

image

Check will be triggered after 12 iterations, 37, 62, 87, 112, … very very weird numbers indeed

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

No branches or pull requests

1 participant