Repository navigation
Simplify content file globbing and remove FileProviders.Abstractions and Primitives from VSIX - #7338
Conversation
zivkan
left a comment
There was a problem hiding this comment.
FWIW, I'm not a fan of the AI generated PR description. It duplicated some information, and gave some information that I consider not helpful as a reviewer. I feel like it kind of misses the point, or at least put me on slightly the wrong mental context, when thinking about the manual testing that happened on the VM (the focus was to test the removed assemblies didn't cause failures on msbuild restore, not to do exhaustive edge case testing, which really should be done with unit tests, not manual tests).
|
Thanks for the feedback, @zivkan ! Updated the Validation section in the PR Description to be more focused on the validation of restore, not necessarily edge cases for content file patterns. |
…and Primitives from VSIX
Benchmark results (20,540 match operations per iteration):
| Approach | Mean | Allocated |
|---------------------------------- |---------:|----------:|
| Branch_MatchRelativePath (old) | 73.41 ms | 135.87 MB |
| Dev_ExecuteWithFileProvider | 38.37 ms | 84.21 MB |
| Proposed_Split (SingleFileDir) | 31.21 ms | 64.20 MB |
| MatchRoot_RelativePath | 28.61 ms | 45.46 MB |
| Proposed_Span | 35.07 ms | 70.78 MB |
matcher.Match("ROOT", relativePath) is the fastest and simplest.
Co-authored-by: Copilot <[email protected]>
Reviewer feedback: matcher.Match("ROOT", relativePath) is simpler
and benchmarks show it's the fastest approach (~28ms vs ~31ms for
SingleFileDirectory, ~73ms for the old Match(path) without root).
Deletes SingleFileDirectory.cs — no longer needed.
Co-authored-by: Copilot <[email protected]>
…leProvider" This reverts commit 8bc5fa537805740ec759d4a2d9e24048f87514af.
17a02e8 to
1bffe08
Compare
|
@copilot some tests failed. Can you investigate this error and attempt a fix in this PR?: Error message |
Fixed in dd1a9ad. I reproduced the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch. |
Bug
Fixes: NuGet/Home#14686
Fixes: NuGet/Home#12696
Description
Removes
Microsoft.Extensions.FileProviders.Abstractions.dllandMicrosoft.Extensions.Primitives.dllfrom the VSIX by eliminating the code dependency on them.What changed
SingleFileProvider,FileProviderGlobbingDirectory,FileProviderGlobbingFile,VirtualFileInfo) with a direct call tomatcher.Match("ROOT", relativePath). No custom classes needed.Microsoft.Extensions.FileProviders.Abstractionspackage reference fromNuGet.Commands.csprojand
Directory.Packages.props..vsixinclude,.vsixignore,.swr, andilmerge.propsto exclude the two removed assemblies.What stays
Microsoft.Extensions.FileSystemGlobbingremains — it provides theMatcherclass used for content file glob patternmatching.
Performance
Benchmarked the content file globbing hot path across 2,428 packages from the global packages folder (20,540 match operations per iteration):
Match("ROOT", path)The new approach is ~25% faster and allocates ~46% less memory by using
Matcher.Match("ROOT", relativePath)directly, avoidingIFileProviderindirection and virtual file info object creation entirely.Validation
Validated on a clean VM (VS installed from Apex & E2E pipeline bootstrapper, MSBuild 18.7.0-preview) that the refactored
content file globbing produces identical restore output.
contentFilessection ofproject.assets.jsonbetween stock SDK NuGet and this branch.msbuild -t:Restore(branch CLI) — identical to baselinePR Checklist