Refactor analytic view functions to use less memory #2270
+364
−104
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.
Prerequisites
Reviewed the checklist
Reviewed feedback from the "Sonar Cloud" bot. Note that you have to wait
for the "CI / Unit Tests") to complete first. Failed Unit tests can be
debugged by adding the label "verbose logging" to the GitHub PR.
Description of the Change
Refactored some of the functions used in different algorithms in the Analytic View to avoid Out of Memory errors. Currently, the only change is avoiding declaring
BitSet
variables when they aren't needed. The size of theseBitSet
variables were directly proportional to the number of nodes on a graph, and the number of these variables created is also directly proportional to the number of nodes. Now, they are only created when needed.Alternate Designs
A more in-depth rework of each of these functions could be done to be more efficient.
Why Should This Be In Core?
N/A
Benefits
Lowered the memory use of centrality algorithms. These were unusable for graphs with many nodes.
Possible Drawbacks
None.
Verification Process
Applicable Issues
#2199