Repository navigation
[release/11.0.1xx] [registrar] Cache registrar callback and protocol method lookups - #26826
Conversation
Postprocessing previously searched all loaded assemblies for each relocated callback, rescanned each callback type's methods, and compared every pre-trim protocol method against an ever-growing list. Cache companion assembly and callback-name lookups, and use a set of protocol method names while preserving the original order and duplicate handling. Cover multiple relocated callbacks with a focused preparation/postprocessing regression test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f3637ab8-80a2-44df-9ecc-97ddf253d54d
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The backport matches the merged source PR, but required CI checks are still queued or running.
Review effort: Balanced
Findings: None
What changed in this PR
Backports registrar postprocessing performance improvements from #26733 to release/11.0.1xx.
Changes:
- Caches companion assemblies and callback-method lookups.
- Uses a hash set to deduplicate protocol methods efficiently.
- Adds regression coverage for relocated and trimmed protocol callbacks.
| File | Description |
|---|---|
tools/dotnet-linker/Steps/ManagedRegistrarStep.cs |
Adds registrar lookup caches. |
tools/common/StaticRegistrar.cs |
Optimizes protocol-method deduplication. |
tests/assembly-preparer/ManagedRegistrarStepTests.cs |
Tests preparation and postprocessing behavior. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Merge blocker: conflicts with At head Required fix: update the PR branch against the current I have not modified this PR's branch or started a duplicate retry. Note This CI analysis was generated by GitHub Copilot. |
|
@copilot resolve the merge conflicts in this pull request |
|
@copilot resolve the merge conflicts in this pull request |
…backport-pr-26733-release/11.0.1xx-2026-10-02 # Conflicts: # tests/assembly-preparer/ManagedRegistrarStepTests.cs Co-authored-by: dalexsoto <204671+dalexsoto@users.noreply.github.com>
Head branch was pushed to by a user without write access
This comment has been minimized.
This comment has been minimized.
Resolved the conflict with Note This response was generated by GitHub Copilot. |
| callbackMethods = callbackType.Methods.ToLookup (v => v.Name); | ||
| callbackMethodsByName.Add (callbackType, callbackMethods); | ||
| } | ||
| var candidates = callbackMethods [ucoName].ToArray (); |
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Distinct iOS stress-test hang needs investigation; this is not the known redirect-stall signature At head In both configurations, the stderr log shows the entire The stress test is configured for 15 seconds in CI and wraps its work in Required investigation: determine where the stress workers, cancellation/disposal paths, or teardown stop completing, and ensure the test's timeout/cleanup can terminate and report a useful failure. Inspect the captured run/thread diagnostics before deciding whether the underlying problem is in the handler, test/harness, or simulator. I have not established that this PR's registrar changes caused it, or that these two stress hangs are merely retryable infrastructure failures. The same build also has a separate Detailed evidence is in Note This CI analysis was generated by GitHub Copilot. |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #a0ca9fa] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 269 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |

Postprocessing previously searched all loaded assemblies for each relocated callback, rescanned each callback type's methods, and compared every pre-trim protocol method against an ever-growing list. Cache companion assembly and callback-name lookups, and use a set of protocol method names while preserving the original order and duplicate handling. Cover multiple relocated callbacks with a focused preparation/postprocessing regression test.
The regression test also simulates trimming a protocol method after preparation, verifying that surviving and pre-trim-only protocol methods each produce exactly one callback.
In a direct replay of captured MAUI HelloWorld inputs with both registrar fixes applied, post-ILLink
ManagedRegistrarSteptook 0.65-0.66 s on two runs versus 3.3-3.6 s in baseline logs. This is a step-only observation, not an end-to-end build-time measurement or an isolated A/B for this PR.🤖 Pull request created by Copilot
Backport of #26733.