Improve type caching by MrJul · Pull Request #142 · kekekeks/XamlX (original) (raw)
Navigation Menu
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Merged
merged 3 commits into
May 20, 2026
Conversation
This PR improves the caching of IXamlType instances in several ways:
- The well-known types are now part of the
IXamlTypeSystemitself, meaning we can use them in places where we don't have the full transformation context. - All used types in the compiler are part of
XamlTypeWellKnownTypes, to avoid any extra lookup (even cached). All call sites using explicitGetType()calls have been adjusted. - Finally,
CecilAssembly.FindTypeis fixed: the old code was looking up types by their full name, but caching them by their short name, meaning the cache didn't hit anything at all...
(cherry picked from commit 61304a6)
(cherry picked from commit ec7b5f3)
(cherry picked from commit 5645d94)
MrJul mentioned this pull request
| [UnconditionalSuppressMessage("Trimming", "IL2062", Justification = TrimmingMessages.TypeInCoreAssembly)] |
| [UnconditionalSuppressMessage("Trimming", "IL2122", Justification = TrimmingMessages.TypeInCoreAssembly)] |
| public XamlTypeWellKnownTypes(IXamlTypeSystem typeSystem) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use primary ctor and make property init inline
MrJul mentioned this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})