-
Notifications
You must be signed in to change notification settings - Fork 448
Refine string builder usage in logging pkg #288
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
Refine string builder usage in logging pkg #288
Conversation
2034484 to
d664cfd
Compare
logging/logging.go
Outdated
| var ( | ||
| DefaultDirName = filepath.Join("logs", "csp") | ||
|
|
||
| defaultLogMsgBufferSize = 256 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe make it const is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A const is not convenient for benchmark test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my perspective, Benchmark is to test performance and shouldn't impact the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll refine it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll refine it.
d664cfd to
1813496
Compare
Codecov Report
@@ Coverage Diff @@
## master #288 +/- ##
==========================================
+ Coverage 51.09% 51.24% +0.15%
==========================================
Files 79 79
Lines 4026 4049 +23
==========================================
+ Hits 2057 2075 +18
- Misses 1679 1684 +5
Partials 290 290
Continue to review full report at Codecov.
|
louyuting
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contribution!
Describe what this PR does / why we need it
Use string builder grow to reduce memory allocations in logging pkg.
Benchmark result:
Does this pull request fix one issue?
Describe how you did it
Describe how to verify it
Special notes for reviews