Repository navigation
Fix public symbol lookup perf - #6251
Conversation
Pair public-tag names with ordinary lookup displacement to avoid reverse name resolution. Known symbol-start mismatches remain; this is a prototype. Co-authored-by: Copilot <[email protected]> Copilot-Session: 56b7f1ec-323f-44e6-bee9-b2af0e9fc062
Co-authored-by: Copilot <[email protected]> Copilot-Session: 56b7f1ec-323f-44e6-bee9-b2af0e9fc062
|
Are we OK with the correctness displacement issue? |
Yes, as far as I can tell this shouldn't impact any 'managed' code (including NativeAOT). |
|
Have we tested:
Since I think this PR does have the issue of not picking a particularly stable name in case of folding with ICF (which ILC does do). |
Yes, I tried this approach. Unfortunately, This is unlike the |
I see - this is essentially |
Summary
A faster replacement for the public-name reverse lookup introduced in #6242:
IDebugAdvanced2.GetSymbolInformation(GET_SYMBOL_NAME_BY_OFFSET_AND_TAG_WIDE, address, SymTagPublicSymbol).IDebugSymbols3.GetNameByOffsetWidecall instead of reverse-resolving the public name withGetOffsetByNameWide.DbgEngModuleSymbolshelper, leavingDebuggerServicesas the low-level wrapper.Performance
Measured on Windows x64 using a synthetic workload with 100,000 generated methods and 215,422 public PDB symbols:
GetNameByOffsetwith globalPUBLICS_ONLYThe proposed lookup avoids the expensive reverse-name lookup. Compared with the original global-public-only behavior, warm lookup time is approximately 40.2% higher (+7.02 us/query). There is no module-wide symbol cache.
Known correctness limitations
Ordinary lookup can select a private symbol with a different starting address from the selected public symbol. Pairing its displacement with the public name can therefore report an incorrect public-symbol start.
Against an original-public-only reference:
<PERF>formatting differences and one before-first-public boundary difference were recorded separately.