This repository has been archived by the owner on May 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Reimplement IPSet.Ranges with a (somewhat) easier to follow algorithm. #124
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
Member
danderson
commented
Jan 27, 2021
•
edited
Loading
edited
danderson
force-pushed
the
danderson/bug-demo
branch
5 times, most recently
from
January 27, 2021 07:09
117f074
to
d6a364c
Compare
Signed-off-by: David Anderson <[email protected]>
Signed-off-by: David Anderson <[email protected]>
danderson
force-pushed
the
danderson/bug-demo
branch
from
January 27, 2021 07:12
d6a364c
to
8e07aed
Compare
danderson
changed the title
ipset: add an internal check that generated IPRanges are valid.
Reimplement IPSet.Ranges with a (somewhat) easier to follow algorithm.
Jan 27, 2021
mdlayher
approved these changes
Jan 27, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and I appreciate the ASCII diagrams!
bradfitz
reviewed
Jan 27, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
The main goal was to fix #125 by providing a less tricky implementation of Ranges as a comparison baseline... But this implementation turns out to also be a bit faster and more memory efficient. Fixes #125. name old time/op new time/op delta IPSetFuzz-8 16.3µs ± 3% 14.1µs ± 1% -12.99% (p=0.008 n=5+5) name old alloc/op new alloc/op delta IPSetFuzz-8 2.60kB ± 0% 1.95kB ± 0% -25.24% (p=0.008 n=5+5) name old allocs/op new allocs/op delta IPSetFuzz-8 33.0 ± 0% 30.0 ± 0% -9.09% (p=0.008 n=5+5) Signed-off-by: David Anderson <[email protected]>
Signed-off-by: David Anderson <[email protected]>
danderson
force-pushed
the
danderson/bug-demo
branch
from
January 29, 2021 00:55
3ffd647
to
b265e07
Compare
Looks much better with the symbolic names for each case, thanks. Applied all feedback, going to submit and we can bikeshed on the exact names of helpers in a followup (I'm not super happy with some of the subtler ones). |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.