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

metric/system: preallocate arrays #116

Merged
merged 1 commit into from
Nov 23, 2023
Merged

metric/system: preallocate arrays #116

merged 1 commit into from
Nov 23, 2023

Conversation

florianl
Copy link
Member

What does this PR do?

Whenever possible, preallocate array to the correct size instead of letting arrays "grow". This reduces the load on the Garbage Collector and improves memory usage efficiency.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.md

Whenever possible, preallocate array to the correct size instead of letting
arrays "grow". This reduces the load on the Garbage Collector and improves
memory usage efficiency.

Signed-off-by: Florian Lehner <[email protected]>
@florianl florianl requested a review from a team as a code owner November 20, 2023 09:43
@florianl florianl requested review from ycombinator and faec and removed request for a team November 20, 2023 09:43
@florianl

This comment was marked as duplicate.

@florianl florianl merged commit dd6d8b7 into main Nov 23, 2023
florianl added a commit that referenced this pull request Dec 21, 2023
## What does this PR do?

Reintroduce the improvements from
#103. This
PR got reverted with
#113 because
of #109.
The issue, that got reported in
#109, was
fixed with
#116.

So its time to bring back the performance improvements by reintroducing
the cache for cgroup v2.

## Why is it important?

<!-- Mandatory
Explain here the WHY, or the rationale/motivation for the changes.
-->

## Checklist

<!-- Mandatory
Add a checklist of things that are required to be reviewed in order to
have the PR approved

List here all the items you have verified BEFORE sending this PR. Please
DO NOT remove any item, striking through those that do not apply. (Just
in case, strikethrough uses two tildes. ~~Scratch this.~~)
-->

- [x] My code follows the style guidelines of this project
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] ~~I have added tests that prove my fix is effective or that my
feature works~~
- [ ] ~~I have added an entry in `CHANGELOG.md`~~

---------

Signed-off-by: Florian Lehner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants