- Notifications
You must be signed in to change notification settings - Fork13.9k
Experiment: New fmt::Arguments implementation#148529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
fmt::Arguments can now store a &str without any indirection andadditional storage: There is now a fmt::Arguments::from_str() function.
@bors try@rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Experiment: New fmt::Arguments implementation
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
The job Click to see the possible cause of the failure (guessed by this bot) |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (89ea077):comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.6%, secondary -0.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 4.5%, secondary -4.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.2%, secondary -0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 473.384s -> 471.178s (-0.47%) |
Uh oh!
There was an error while loading.Please reload this page.
Part of#99012
Continuation of#137294
This is an experimental new implementation of
fmt::Arguments. In this implementation,fmt::Argumentsis only two pointers in size. (Instead of six, currently.) This makes it the same size as a&strand makes it fit in a register pair.Additionally, this
fmt::Argumentscan store a&'static strwithout any indirection or additional storage. This means that simple cases likeprint_fmt(format_args!("hello"))are now just as efficient for the caller asprint_str("hello"), as shown by this example:Similarly,
panic!("Hello, world!");shows the same change.To do: