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

use slices as backing data structure for v2_sets #540

Merged
merged 24 commits into from
Apr 10, 2024

Conversation

saiskee
Copy link
Contributor

@saiskee saiskee commented Apr 8, 2024

BOT NOTES:
resolves #543

@solo-changelog-bot
Copy link

Issues linked to changelog:
#543

@saiskee saiskee marked this pull request as ready for review April 9, 2024 14:03
// Insert adds items to the set in inserted order.
// If an item is already in the set, it is overwritten.
// The set is sorted based on the ResourceId of the resources.
func (s *resourceSet[T]) Insert(resources ...T) {
Copy link
Member

@yuval-k yuval-k Apr 9, 2024

Choose a reason for hiding this comment

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

we're changing insertion and lookup to be O(log(n))instead of O(1). Did we verify this doesn't cause perf issues?

pkg/ezkube/resource_id.go Outdated Show resolved Hide resolved
pkg/ezkube/resource_id.go Outdated Show resolved Hide resolved
@saiskee saiskee requested review from yuval-k and EItanya April 9, 2024 21:12
@saiskee saiskee changed the title Sai/sets v2 iter use slices as backing data structure for v2_sets Apr 9, 2024
@soloio-bulldozer soloio-bulldozer bot merged commit 9f6b5ae into main Apr 10, 2024
3 checks passed
@soloio-bulldozer soloio-bulldozer bot deleted the sai/sets-v2-iter branch April 10, 2024 17:19
yuval-k pushed a commit that referenced this pull request May 20, 2024
* update

* remove compare resource ids

* add iter

* fix iter

* add iter impl

* add inefficient list as cop out

* add filters to inefficient list

* fix inefficient list

* fix inefficient list

* inefficient list inverted

* remove inefficient list

* add length method to set/

* update

* update

* update v2 sets with better funciton names

* update v2 sets with better funciton names

* remove FilterOutAndIterate method

* add Get

* add comments

* add changelog and remove test focus

* move changelog/

* move changelog

* fixes for PR review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change v2 sets to be more efficient
3 participants