5001-node-selection-algorithm speed increase.#27
Open
burdettadam wants to merge 2 commits intosovrin-foundation:masterfrom
Open
5001-node-selection-algorithm speed increase.#27burdettadam wants to merge 2 commits intosovrin-foundation:masterfrom
burdettadam wants to merge 2 commits intosovrin-foundation:masterfrom
Conversation
Signed-off-by: Lynn Bendixsen <lynn@sovrin.org>
Signed-off-by: Adam Burdett <burdettadam@gmail.com>
This file contains hidden or 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
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.
20 minutes to less than 10 seconds on my test data.
To get this speed increase:
unique_combinationsand usedcombinationsfrom itertools.Poolfrom multiprocessing to do a MapReduce on batches from unique_combinations.I do not have time to work on this code anymore. If needed, more speed could be achieved by using panda to read in the config and create a table that would allow unique combinations to be represented by indexes of that table. this would cut down some un-needed computation.
ComboAnalysiscould also be optimized by having a pre-allocated array for maintaining the best combinations. I saw significant time being spent in an array append method insideComboAnalysis, with the way batches are being processed, this would be a significant speed increase.Another possible speed increase would be using a library like numpy for all math operations.
This code needs to be tested more than what I have done.