Suboptimal code generation for string literal logs #365
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#365
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
#278 optimized generated logging code size by packaging up all of the probably-static bits of a log directive (the target, module path, file, and line) up into a single pointer-to-tuple, with the idea being that the compiler would just stick that tuple in .rodata and be able to just load a pointer to it when calling
__private_api_log.Unfortunately, it appears that the compiler is no longer lifting that tuple into a static, and it is instead being assembled on the stack:
https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=b9384ea3c6f7870c1d8b12df6e33ce99
cc @Amanieu
I may have misread this - the thing being assembled on the stack is actually the Arguments struct, not the tuple.
It seems like we may want a separate function when the argument's just a string literal.