tsort: add sequential access hint to applicable platforms for performance - #14415
tsort: add sequential access hint to applicable platforms for performance #14415anastygnome wants to merge 1 commit into
Conversation
858de65 to
aacc8c1
Compare
|
you did much more than the title suggests, no ? :) |
b36dd8b to
7c56e99
Compare
|
@sylvestre please merge #14384 it's an important security fix, I just included it here to do the tests as I don't have access to a windows machine ^^' |
|
Is it able to apply this also for |
It should, it's now exposed on cygwin by rustix, and it's cfg unix, so it should work, I added it |
1caa1c6 to
0790d8b
Compare
|
@sylvestre ready to merge ;) |
Merging this PR will not alter performance
Comparing Footnotes
|
|
GNU testsuite comparison: |
| target_os = "solaris", | ||
| target_os = "vita", | ||
| )) | ||
| ))] |
There was a problem hiding this comment.
Too complex and most targets are out of scope of uutils. Would you list supported targets instead?
There was a problem hiding this comment.
This is a not clause though. I did this to have extensibility, and not having to align with rustix whenever we'll add a target
There was a problem hiding this comment.
One day rustc will support is_function_accsssible and this hack won't be needed
|
It might better to add a open wrapper doing fadvise on many unix, FILE_FLAG_SEQUENTIAL_SCAN on Windows, and no-op on others to |
Cannot be done cleanly, sadly, as on winfows it must be done before opening, and on Linux afterwards, it will still be convoluted, and we still have to manage the isdir case on windows which is hard to get right. It's not that hard to read for now with a comment |
On unix plateforms, we advise the OS of the sequential access to the graph file.
There's no reason not to do it on windows too
The change to the code is minimal touse
File::Optionsto open the file and there's virtually no cost for thisNOTE : we now open the input file read-only explicitely, but that's arguably better.
waiting for #14384 to be merged. Already includes it.