Improve excluded nets filter performance dractically #787
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.
For huge cidr block ranges (
10.0.0.0/8) the old implementation was extremely expensive, since it added all the individual IPs to the BTreeSet which resulted both in high memory consumption and poor performance. By utilizingIpCidr, the check is nearly instant, and it works without problems with bigger cidr blocks.Old Implementation (DNF with
10.0.0.0/8)address parsing/parse addresses with exclusions time: [107.30 ms 107.94 ms 108.86 ms] change: [+277719% +279652% +282043%] (p = 0.00 < 0.05) Performance has regressed.New Implementation (No trouble with
10.0.0.0/8)address parsing/parse addresses with exclusions time: [37.388 µs 37.473 µs 37.565 µs] change: [+32.133% +32.611% +33.098%] (p = 0.00 < 0.05) Performance has regressed.(regression is due to switching from
IpNettoIpCidrto not introduce a new dependancy)