-
Notifications
You must be signed in to change notification settings - Fork 19
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
More index optimisations #923
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit special cases the dependency calcs so at least one calc_abc sub is always run first when _calc_abc_any is a dependency. Many indices only need the abc counts or the keys of the label hashes. These can use any of calc_abc, calc_abc2 and calc_abc3. Recent commits added the capacity to grab any local precalc result, and this can be used to support a calc_abc_any sub.
Also fix a typo in metadata description.
It needs hash values of 1, which abc2 and abc3 do not usually provide.
If calc_abc2 or calc_abc3 have already been calculated then we can just grab their results and set the label hashes to have values of 1. This avoids a lot of looping in several circumstances, for example where large neighbour sets in a spatial analysis or where cluster indices are calculated per node.
This will save some processing given calc_abc can now adapt their results.
Caches can be deleted with impunity so might be interfered with in the middle of processing.
If we have no second neighbour set then there is no need to run all the hash processing.
If labels_hash2 is empty then the central and whole variants are the same. So just grab them and remap the keys.
This will avoid a lot of processing when both are being calculated as the results will be the same in such cases.
No need to go recalculate everything in these cases.
This avoids a lot of extra computation for calculations on cluster nodes as internal nodes can combine their child node results instead of iterating over the all the terminal elements.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes several optimisations. Chief among them are: