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

loop performance optimizations / 1 #3313

Merged
merged 6 commits into from
Dec 5, 2024
Merged

loop performance optimizations / 1 #3313

merged 6 commits into from
Dec 5, 2024

Conversation

mmetc
Copy link
Contributor

@mmetc mmetc commented Nov 4, 2024

this linter prevents the copy of big struct elements in loops over slices or maps

how often the loop is executed, or how many iterations, is not taken in consideration by the linter - many cases are not a performance issue but there's no downside in fixing them except for the minor convenience of access-by-index

@mmetc mmetc added the kind/enhancement New feature or request label Nov 4, 2024
@mmetc mmetc added this to the 1.6.4 milestone Nov 4, 2024
Copy link

github-actions bot commented Nov 4, 2024

@mmetc: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 8 lines in your changes missing coverage. Please review.

Project coverage is 58.45%. Comparing base (7a1ad83) to head (75f3ea5).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/types/event.go 0.00% 3 Missing ⚠️
pkg/parser/node.go 71.42% 2 Missing ⚠️
...g/acquisition/modules/kubernetesaudit/k8s_audit.go 91.66% 1 Missing ⚠️
pkg/leakybucket/overflows.go 93.33% 1 Missing ⚠️
pkg/parser/runtime.go 93.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3313   +/-   ##
=======================================
  Coverage   58.45%   58.45%           
=======================================
  Files         351      351           
  Lines       37801    37818   +17     
=======================================
+ Hits        22096    22107   +11     
- Misses      13803    13809    +6     
  Partials     1902     1902           
Flag Coverage Δ
bats 41.24% <59.61%> (-0.07%) ⬇️
unit-linux 34.44% <73.07%> (+0.05%) ⬆️
unit-windows 29.67% <73.07%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mmetc mmetc modified the milestones: 1.6.4, 1.6.5 Nov 8, 2024
@mmetc mmetc marked this pull request as draft November 8, 2024 14:01
@mmetc mmetc force-pushed the lint-rangeValCopy branch from f5d30b8 to 631aa00 Compare November 18, 2024 14:16
@mmetc mmetc force-pushed the lint-rangeValCopy branch from 631aa00 to 3d1be7e Compare November 27, 2024 10:48
@mmetc mmetc force-pushed the lint-rangeValCopy branch from 3d1be7e to ef270e0 Compare December 5, 2024 09:54
@mmetc mmetc marked this pull request as ready for review December 5, 2024 10:08
@mmetc mmetc requested a review from blotus December 5, 2024 10:08
@mmetc mmetc changed the title loop performance optimizations loop performance optimizations / 1 Dec 5, 2024
@mmetc mmetc merged commit 411bb48 into master Dec 5, 2024
17 checks passed
@mmetc mmetc deleted the lint-rangeValCopy branch December 5, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request needs/area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants