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

Eliminate some allocations from ordinary index search #264

Open
jeltsch opened this issue Jun 22, 2024 · 5 comments
Open

Eliminate some allocations from ordinary index search #264

jeltsch opened this issue Jun 22, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@jeltsch
Copy link
Collaborator

jeltsch commented Jun 22, 2024

The search function of the ordinary index can probably get by with less allocations. We shall conduct a micro-benchmark in the style of the compact-index micro-benchmark and use its results to reduce the allocation count by turning specific patterns into bang patterns. See #244 (comment) and follow-ups.

We shall extend the above-mentioned optimization to the binarySearchL function for immutable vectors, which is used by search, in case we haven’t ended up implementing that function by reusing binarySearchL from vector-algorithms.

@jeltsch jeltsch added the enhancement New feature or request label Jun 22, 2024
@jeltsch jeltsch self-assigned this Jun 22, 2024
@jeltsch
Copy link
Collaborator Author

jeltsch commented Sep 16, 2024

We have ended up implementing the binarySearchL function for immutable vectors by reusing binarySearchL from vector-algorithms (see #256); so there is nothing to be done regarding that function.

@jeltsch
Copy link
Collaborator Author

jeltsch commented Sep 16, 2024

Note that #393 introduces a variable overflowPageCount, which is local to the variable end and is used only in the first branch of end’s definition, so that its binding pattern should probably not be made strict, as it is not used in the second branch of end’s definition.

@jeltsch
Copy link
Collaborator Author

jeltsch commented Sep 21, 2024

Note that #393 introduces a variable overflowPageCount, which is local to the variable end and is used only in the first branch of end’s definition, so that its binding pattern should probably not be made strict, as it is not used in the second branch of end’s definition.

During further changes within #393, things were arranged differently such that now the above-mentioned issue doesn’t occur anymore.

@jeltsch
Copy link
Collaborator Author

jeltsch commented Sep 21, 2024

There were sensible strictness annotations introduced as part of #393. We should check whether a micro-benchmark is still needed or whether we can trust that the present implementation is fine.

@jorisdral
Copy link
Collaborator

A micro-benchmark would still be useful IMO, and it does not have to be a particularly elaborate one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants