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

Optimize element lookup in FileSystemFinder by switching from []string to map[string]struct{} #115

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

SkobelkinYaroslav
Copy link
Contributor

changed []string to map[string]struct{} in FileSystemFinder struct fields because of optimization (arrays were used only to check the occurrence of an element)

Yaroslav and others added 2 commits February 28, 2024 22:43
…elds because of optimization (arrays were used only to check the occurrence of an element)
@kehoecj kehoecj added the OSS Community Contribution Contributions from the OSS Community label Feb 29, 2024
Copy link
Collaborator

@kehoecj kehoecj left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I did some local benchmarking and the improvements were around 20-50%! One suggested change

pkg/finder/fsfinder.go Outdated Show resolved Hide resolved
@kehoecj kehoecj added the pr-action-requested PR is awaiting feedback from the submitting developer label Mar 11, 2024
@kehoecj kehoecj merged commit c824e2a into Boeing:main Mar 18, 2024
4 checks passed
@kehoecj
Copy link
Collaborator

kehoecj commented Mar 18, 2024

Merged - thank you for your contribution @SkobelkinYaroslav !

shiina4119 pushed a commit to shiina4119/config-file-validator that referenced this pull request Aug 23, 2024
…g to map[string]struct{} (Boeing#115)

* changed []string to map[string]struct{} in FileSystemFinder struct fields because of optimization (arrays were used only to check the occurrence of an element)

* Changed field Extensions type in FileType from []string to map[string]struct{}

* added requested changes

---------

Co-authored-by: Yaroslav <=>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OSS Community Contribution Contributions from the OSS Community pr-action-requested PR is awaiting feedback from the submitting developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants