Optimize logging codegen #276
No reviewers
Labels
No labels
bug
duplicate
easy
enhancement
help wanted
invalid
question
rfc
structured-logging
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-rust-lang/log!276
Loading…
Reference in a new issue
No description provided.
Delete branch "codegen"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The extra work involved in loading the logger and creating the record
struct involves move codegen than is necessary if we take this kind of
approach (which we previously used in 0.3). It's a bit unfortunate to
have these public-but-not-public functions, but I think it's worth it.
We want to minimize the footprint of logging so people feel comfortable
using it!
A main function containing nothing but
warn!("hello world")shrinksfrom 204 bytes to 124 bytes in x86_64 with this change.
Closes #275
r? @KodrAus
This looks good to me! Do you think it's worth leaving a comment on
__private_api_logmotivating it as reducing generated code size in crates that uselog?I generally like to use git-blame for that kind of background, but it also seems fine to add.
git-blame seems reasonable to me 👍