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 resource utilization parser for linux #4744

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

rafal-mz
Copy link
Contributor

@rafal-mz rafal-mz commented Nov 20, 2023

LinuxUtilizationParser class is protected by lock and used internally to get utilization data from Linux OS. Parser allocates a pool of buffers at ctor time. Usage of this class makes pool of buffer writes not needed. We can just allocate one buffer writer and pass it around.

This change improves both memory that we used to maintain the pool and cycles to pass around buffer writer instance.

@ghost ghost assigned rafal-mz Nov 20, 2023
Comment on lines +14 to +15
/// This class is not thread safe.
/// When the same instance is called by multiple threads it may return corrupted data.
Copy link
Member

Choose a reason for hiding this comment

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

Suggest moving this as <remarks>. Intellisense shows those, making the discoverability easier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, it should be remarks. Thanks for spotting. :-)

@geeknoid geeknoid merged commit c66f947 into main Nov 22, 2023
6 checks passed
@geeknoid geeknoid deleted the rmzyk/optimize-utilization-parser branch November 22, 2023 14:12
@ghost ghost added this to the 8.1 milestone Nov 22, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants