Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #41817 to release/5.0-rc2
/cc @carlossanlop
Customer Impact
Perf regression as described in detail in #41739.
PR #40641 made a change to “Ensure FileStatus and FileSystemEntry Hidden and ReadOnly attributes are retrieved the same way.” This fixed an issue discovered in PowerShell that “FileSystemEntry.Attributes property is not correct on Unix.” The change was made in 5.0 RC1 but our perf runs identified the regression that the fix introduced. We seek to revert that PR, reintroducing the bug, but eliminating the perf regression. We will then address the initial bug with a different approach in 6.0.
Testing
The affected benchmark was run with and without this change, which showed a 4.37 perf regression when comparing results (before = without the bug fix, after = with the bug fix):
Risk
The code fix will be reverted so the bug will be brought back, but we will not have a negative performance impact in 5.0. Reintroducing the bug will affect PowerShell (where #37301 was first discovered). We confirmed with @SteveL-MSFT that this is acceptable; the bug will remain a known issue in 5.0.