lib: Speedup prefix-list readin by a large factor #13005
Merged
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.
Reading in prefix-lists is reading in the specified prefix list and validating that the prefix is unique 2 times. This makes no sense. Relax the requirement that a prefix list can limit this as well as completely remove this check. Validation then just becomes
does this prefix-list specified actually make sense and that is taken care of by the the cli code.
Reading in prefix-lists was looking for duplicate prefixes 2 times instead of doing it just one time. Let's just not do it at all.
By doing this change, The code changes from never
completing for a 27k long prefix-list to taking
just under 30 seconds, with 4 daemons processing
this data.