-
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
A set of general optimisations #916
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
No need to build a large array when we can process as we go. This uses les memory and allows a few faster approaches.
We can use direct assignment of the whole hash in first element_list iter, thus avoiding some looping and slicing.
It was being used to get the element lists, but these are passed anyway and calc_abc returns hashes instead of arrays.
This is an optimised variant of _calc_abc that triggers when there is only one item in $args{element_list 1} and no other lists are passed. In such cases there is no need to run many of the checks and the results can be more direct. This is also the most common use case.
No need to search for the set of list indices every time when this does not change.
Will make a small speed difference in some cases.
BaseStruct::get_element_property_keys caches its return value, and we change its cache key to a state var.
Previously it would trigger on zero.
We can avoid a lot of work if we know the labels have no range property.
One autovivifies, the other does not.
These labels will all be swapped anyway so there is no need to subset the list. A late update to #822 after the main PR.
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.
First few commits are focused on _calc_abc but later commits span other parts of the system.