Skip to content

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

Merged
abhinavdangeti merged 1 commit intoblevesearch:masterfrom
Gusted:remove-sloppy-math
Nov 13, 2024
Merged

feat: remove sloppy math for sin, cos and asin#2093
abhinavdangeti merged 1 commit intoblevesearch:masterfrom
Gusted:remove-sloppy-math

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
@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