Repository navigation
src: do not format the values of the fields for the logs without the logger - #53
Merged
Merged
Conversation
…logger Signed-off-by: Dmitriy Aleksandrov <goodmobiledevices@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #53 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 32 32
Lines 2630 2638 +8
=========================================
+ Hits 2630 2638 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Benchmark diff:
|
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.
The CPU and memory profiles of
Parseshowed that without the logger a quarter of the allocations and ~6% of CPU were spent on the log records that nobody writes:Withper field and driver, the fields ofinitial,skip,override, the values formatted byfmt.Sprintf, the texts of the errors. NowParseand the reloads skip it if the logger is the noop one (noWithLogger). The behaviour with the logger, including the deferred one, is not changed.Also checked, no changes needed:
Subscribeand cancel, and 9 000 reloads of a file with the subscriber, leave the same number of goroutines after the cancel;Manager,Currentis atomic.