-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the backing data structure of VarSet from slice to map #1224
Conversation
Welcome @ian-howell! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ian-howell The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @monopole Performance optimizations |
@ian-howell: GitHub didn't allow me to assign the following users: Performance, optimizations. Note that only kubernetes-sigs members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I believe travis has croaked on this one. Closing and reopening to trigger a new build |
This will speed up most operations performed on a large set of Vars
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.
so, this is a sorted list, not a map, because it optimizes for easily emitting a sorted list of var names in debugging and error messages. anyone who's builds are noticeably slowed by O(N) var lookups during a build
is doing some use case that needs a blog post. How many vars would it take to make a noticeable difference? 10,000? Why would someone use that many?
don't mind the code change as long as String() emits a sorted list of var names.
s[i] = v | ||
i++ | ||
} | ||
sort.Sort(ByName(s)) |
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.
Please toss in a String() method that calls this method so we get deterministic ordering when debugging.
/lgtm |
nevermind, if it becomes an issue, will add the String() |
This will speed up most operations performed on a large set of Vars
More detailed information in this issue.