-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
perf(fs/windows): stat - only open file once #27487
perf(fs/windows): stat - only open file once #27487
Conversation
@@ -61,7 +61,7 @@ impl FileSystem for RealFs { | |||
umask(Mode::from_bits_truncate(mask as mode_t)) | |||
} else { | |||
// If no mask provided, we query the current. Requires two syscalls. | |||
let prev = umask(Mode::from_bits_truncate(0o777)); | |||
let prev = umask(Mode::from_bits_truncate(0)); |
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.
|
||
let result = get_dev(file_handle); | ||
fsstat.dev = result?; | ||
fsstat.dev = get_dev(file_handle)?; |
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.
We also previously weren't closing the file_handle on error here.
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.
LGTM, good catch
Even debug is way faster: