GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Avoid extra SMB queries when formatting file names by daxian-dbw · Pull Request #28038 · PowerShell/PowerShell Conversation
|
| Measurement | PowerShell 7.6.6 without fix | Fixed debug build | Improvement |
|---|---|---|---|
NameString |
3,870 ms | 81 ms | 48x faster |
| Default formatting | 4,250 ms | 727 ms | 5.8x faster |
A same-binary control using the fixed debug build isolates the avoided operation:
| Operation | Median |
|---|---|
Guarded NameString |
81 ms |
Direct unconditional IsReparsePointLikeSymlink probe |
3,939 ms |
This confirms that the approximately 3.9-second cost came from calling FindFirstFile once per item. Absolute formatting times vary between release and debug builds, but the per-item SMB query is eliminated.
.h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No unresolved review issues were identified, and regression coverage was added.
Review effort: Lite
Findings: None
Improves file-name formatting performance by avoiding unnecessary SMB metadata queries for ordinary items.
Changes:
| File | Description |
|---|---|
test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 |
Verifies cached non-reparse items do not reopen their paths. |
src/System.Management.Automation/namespaces/FileSystemProvider.cs |
Avoids unnecessary metadata queries during formatting. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the cached-attribute guard, reparse-point handling, and regression coverage. Looks good to me.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // Checking the cached attributes first avoids an extra filesystem query for every non-link, | ||
| // which is particularly expensive when formatting items on an SMB share. | ||
| if (InternalSymbolicLinkLinkCodeMethods.IsReparsePoint(fileInfo) | ||
| && InternalSymbolicLinkLinkCodeMethods.IsReparsePointLikeSymlink(fileInfo)) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The IsReparsePointLikeSymlink method is used in RemoveDirectoryInfoItem(), so I guess it makes sense to insert this check there too.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That's out of scope for this PR. This PR is only for fixing the formatting.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
c4ae347
into
PowerShell:master
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
PS 7.6 - extremly slow output of dir on network drive
There was an error while loading. Please reload this page.