fix: add StatsWithBuffer method for optimized stats retrieval#106
Merged
safchain merged 1 commit intosafchain:masterfrom May 29, 2025
Merged
Conversation
…ntain backward compatibility Signed-off-by: Ritwik Ranjan <ritwikranjan@microsoft.com>
06f55ef to
1723619
Compare
Contributor
Author
|
@safchain @halfcrazy I have rebased on top of your changes, this gives the user independence in management of the buffer memory. Let me know if it looks good to you! |
Contributor
Author
|
A soft reminder to look at the PR @safchain / @halfcrazy |
Contributor
|
/lgtm |
Contributor
Author
|
@safchain Can we make a release as well? |
Owner
|
Just released the v0.6.1 |
Contributor
Author
|
Perfect, thanks for the quick turnaround! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the
ethtool.gofile to improve code maintainability by introducing a new method for buffer management, and ensuring backward compatibility. Below are the most significant changes:Type Renaming for Consistency:
ethtoolGStringstoEthtoolGStringsandethtoolStatstoEthtoolStatsto align with Go naming conventions for exported types. This change affects type definitions and all instances where these types are used. [1] [2] [3]Buffer Management Enhancements:
StatsWithBufferthat allows pre-allocated buffers (EthtoolGStringsandEthtoolStats) to be passed in, reducing heap allocations and improving performance in Go 1.24+.Backward Compatibility:
Statsmethod to use the newStatsWithBufferinternally while maintaining its original interface, ensuring backward compatibility with existing code. [1] [2] [3]