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

feat: remove sloppy math for sin, cos and asin #2093

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

Gusted
Copy link
Contributor

@Gusted Gusted commented Nov 2, 2024

Remove the LUT implementation for sin, cos and asin. For sin and cos they are not faster than the hardware provided sin and cos instructions on AMD64 and ARM64. For asin LUT does seem to be a bit faster but hardware and LUT implementation are both in the same order of magnitude for performance and asin LUT unconditionally takes 1.5MiB of memory which seems a bit excessive.

If the usage of asin is really performance sensitive (I'm not that familiar with the geo library) it might be better to lazy-load this LUT to avoid users of the bleve library that don't have a use of the geo library to inherit this 1.5MiB of memory.

Remove the LUT implementation for `sin`, `cos` and `asin`. For `sin` and
`cos` they are not faster than the hardware provided `sin` and `cos`
instructions on AMD64 and ARM64. For `asin` LUT does seem to be a bit
faster but hardware and LUT implementation are both in the same order of
magnitude for performance and `asin` LUT unconditionally takes 1.5MiB of
memory which seems a bit excessive.
@abhinavdangeti
Copy link
Member

Thank you for this contribution @Gusted .

@abhinavdangeti abhinavdangeti added this to the v2.5.0 milestone Nov 6, 2024
@abhinavdangeti abhinavdangeti merged commit 81609f8 into blevesearch:master Nov 13, 2024
9 checks passed
@Gusted Gusted deleted the remove-sloppy-math branch November 13, 2024 19:20
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