-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Improve codegen for single argument format_args! #75301
Copy link
Copy link
Closed
Labels
A-fmtArea: `core::fmt`Area: `core::fmt`C-bugCategory: This is a bug.Category: This is a bug.I-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-fmtArea: `core::fmt`Area: `core::fmt`C-bugCategory: This is a bug.Category: This is a bug.I-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I was using
write!in a lot of places, some I just dowrite!(writer, " ")but I noticed that the generated assembly is not as good aswriter.write_all(b" "). Since we have minimalconst fnnow, I wonder if we could improve the generated assembly when a single character or a single argument is passed in.https://rust.godbolt.org/z/zzEMjd
I also
write!()could accept a single byte or character. Example,write!(buf, ' ').If anyone can mentor, maybe I can take on this part (hopefully without compiling rust).
Meta
rustc --version --verbose:CC @lzutao