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

fqdn: Optimize KeepUniqueNames #13920

Merged
merged 1 commit into from
Nov 13, 2020
Merged

Conversation

jrajahalme
Copy link
Member

Not sure if this is of any actual significance, but KeepUniqueNames()
is called from couple of places. Modify it to filter out duplicates in
place so that no memory allocations are needed.

Using naive search for duplicates instead of a map is about 5x faster
for small sets of names.

Signed-off-by: Jarno Rajahalme jarno@covalent.io

@jrajahalme jrajahalme added kind/enhancement This would improve or streamline existing functionality. release-note/minor This PR changes functionality that users may find relevant to operating Cilium. labels Nov 5, 2020
@jrajahalme jrajahalme requested review from a team and jibi November 5, 2020 23:21
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.10.0 Nov 5, 2020
Copy link
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Not sure if this is of any actual significance, but KeepUniqueNames()
is called from couple of places. Modify it to filter out duplicates in
place so that no memory allocations are needed.

Using naive search for duplicates instead of a map is about 5x faster
for small sets of names.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
@jrajahalme jrajahalme force-pushed the pr/jrajahalme/fqdn-keep-unique-names branch from 39a647d to 4d2c760 Compare November 5, 2020 23:33
@jrajahalme
Copy link
Member Author

test-me-please

@aanm aanm added dont-merge/wait-until-release Freeze window for current release is blocking non-bugfix PRs release-note/misc This PR makes changes that have no direct user impact. and removed release-note/minor This PR changes functionality that users may find relevant to operating Cilium. dont-merge/wait-until-release Freeze window for current release is blocking non-bugfix PRs labels Nov 9, 2020
Copy link
Member

@jibi jibi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 🚀

@christarazi
Copy link
Member

test-gke

@christarazi
Copy link
Member

retest-runtime

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 13, 2020
Copy link
Member

@fristonio fristonio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 🚀

@fristonio fristonio merged commit 87b56a4 into master Nov 13, 2020
@fristonio fristonio deleted the pr/jrajahalme/fqdn-keep-unique-names branch November 13, 2020 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement This would improve or streamline existing functionality. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants