-
Notifications
You must be signed in to change notification settings - Fork 4.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
[Unix] Potential performance regression in Directory.EnumerateFiles #41739
Comments
@carlossanlop could this have been caused by #40641? Please make sure to investigate this while we still have time to consider it for RC2. Thanks! Note: If it turns out that the fix we made demands this extra perf cost, we can close this as an acceptable perf regression. |
@tmds might have some interesting input on this |
I think you found it @jeffhandley it looks like every entry now has an extra Another option maybe is to reverse the bug fix and find another approach for 6.0 ? cc @iSazonov |
@adamsitnik where can I find his input? @jeffhandley I'll compare the perf on Linux with and without that change. So we are ok with the perf regression if this turned out to be the root cause? @danmosemsft would you be ok with that? |
Update: My change made the benchmark 4.3 times slower, I think we should revert it:
|
Good call, @carlossanlop. I was leaning toward keeping it, but those are some convincing numbers. Please proceed with reverting the fix. |
In #40641 we concluded to merge as is and then working on refactoring and removing extra P/Invokes. Update: I think a consistency in the API implemented in #40641 is important and the perf regression could be simply fixed by removing new P/Invoke for Hidden on Unix-s. |
We should revert it for 5.0 and then revisit for 6.0. A 4-5x perf regression in such a mainline case as enumerating files is not acceptable. |
I hope it will be in 5.0.1 servicing release - #40641 fixes really a bug. |
Are we sure that reverting #40641 is the only solution? I am not familiar with the implementation and underlying Unix APIs, but since the problem is calling
runtime/src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.Unix.cs Lines 174 to 176 in 1789775
|
@carlossanlop when I tagged @tmds I was hoping to get his input, but he has not provided it yet ;) |
For 5.0 specifically. We need to get back to a good state. Then other fixes for the minor issue that was being addressed by the PR can be investigated: that issue does not meet the 5.0 bar. |
From the data I have, it looks like
Directory.EnumerateFiles
might have very recently regressed onUnix
systems. I've used the word "might" because I am not 100% sure - most of the Unix samples confirm it, but two don't. The ones that don't used the older version of 5.0 (see the table below). Since the bot has not detected it yet, I suspect that this is a regression that has been introduced very recently.@DrewScoggins I've tried to concatenate URL for full historical data of this benchmark but I've failed. Could you please provide such a link?
Repro
System.IO.Tests.Perf_Directory.EnumerateFiles
The text was updated successfully, but these errors were encountered: