[bgen] Replace XPath lookups with Dictionary in DocumentationManager (#25521)
DocumentationManager.TryGetDocumentation was calling `doc.SelectSingleNode("/doc/members/member[@name='...']")` for every member (~30K calls for tvOS). Each XPath query traverses the entire XML DOM, making this O(n*m) where n=members queried and m=total members.
Replace with a `Dictionary<string, XmlNode>` built once at construction time, giving O(1) lookups thereafter.
Performance (tvOS, wall clock time):
- Before: 270s, peak RSS 363MB
- After: 28s, peak RSS 358MB
- Speedup: 9.6x (242s saved)
Generated code: verified identical (git diff = empty).
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> R
Rolf Bjarne Kvinge committed
ca43e4a6252db60596a8287d892e9acaed230769
Parent: 0ab164c
Committed by GitHub <noreply@github.com>
on 5/27/2026, 4:57:29 PM