-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Windows: Use FILE_ALLOCATION_INFO for truncation #134722
Conversation
But fallback to FILE_END_OF_FILE_INFO for WINE
What is the benefit of using |
Tbh, I've been unable to find a difference in the case of My main reason for doing this is because it's what Windows generally uses to truncate a file which makes me think there's some reason I don't know. Maybe there is a filesystem driver that does something differently. |
Ah, setting
And a difference between the two is for setting the allocation:
|
Since this is what Windows does anyways there's no harm in us doing the same. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a92c3cf): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 3.4%, secondary -4.8%)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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 763.56s -> 765.282s (0.23%) |
We use
FILE_END_OF_FILE_INFO
here only because WINE does not supportFILE_ALLOCATION_INFO
. Instead of going with the one with broadest support, let's just use that as fallback only.