Group target_module
, path
and file
arguments
#575
Merged
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 is the first step of bring optimizations from #569 into the
log
crate.This PR contains two commits:
__private_api
module so that it is easier to implement more elaborated optimizations.&(target, module_path, file, line)
argument into two arguments:&(target, module_path, file)
andline
. The idea is that a module could have more than one log calls, so most likely, these log calls would have the same(target, module_path, file)
triple, group them together will allow multiple log calls to reuse a same(target, module_path, file)
instance, see https://godbolt.org/z/z7jW67Ece for comparison.For one of my internal projects, this PR will reduce the binary size by about 2%.
I also tested this PR on
cargo-binstall
, this is the test result: