-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add File
constructors that return files wrapped with a buffer
#130803
Conversation
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (4c62024): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (primary 0.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 769.688s -> 771.199s (0.20%) |
/// # Errors | ||
/// | ||
/// This function will return an error if `path` does not already exist. | ||
/// Other errors may also be returned according to [`OpenOptions::open`]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems incomplete, since it can also return an error from try_new_buffer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, see #131462.
In addition to the light convenience, these are intended to raise visibility that buffering is something you should consider when opening a file, since unbuffered I/O is a common performance footgun to Rust newcomers.
ACP: rust-lang/libs-team#446
Tracking Issue: #130804