Skip to content
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

Merged
merged 1 commit into from
Jun 23, 2019

Conversation

ian-howell
Copy link
Contributor

This will speed up most operations performed on a large set of Vars

More detailed information in this issue.

@k8s-ci-robot
Copy link
Contributor

Welcome @ian-howell!

It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 20, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ian-howell
To complete the pull request process, please assign monopole
You can assign the PR to them by writing /assign @monopole in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 20, 2019
@ian-howell
Copy link
Contributor Author

/assign @monopole Performance optimizations

@k8s-ci-robot
Copy link
Contributor

@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.
For more information please see the contributor guide

In response to this:

/assign @monopole Performance optimizations

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.

@ian-howell
Copy link
Contributor Author

I believe travis has croaked on this one. Closing and reopening to trigger a new build

@ian-howell ian-howell closed this Jun 20, 2019
@ian-howell ian-howell reopened this Jun 20, 2019
This will speed up most operations performed on a large set of Vars
Copy link
Contributor

@monopole monopole left a 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))
Copy link
Contributor

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.

@monopole
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 23, 2019
@monopole monopole merged commit 0ffd78e into kubernetes-sigs:master Jun 23, 2019
@monopole
Copy link
Contributor

nevermind, if it becomes an issue, will add the String()
thanks!

@jbrette jbrette deleted the varset branch June 24, 2019 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants