Improve type caching in the XAML compiler by MrJul · Pull Request #21408 · AvaloniaUI/Avalonia (original) (raw)

What does the pull request do?

This PR improves the performance of the XAML compiler, notably when the project has many references (including transitive ones) containing many types.

Please read the PRs in the XamlX repository for details:

Plus, Avalonia now caches its AvaloniaXamlIlWellKnownTypes once and reuses it for all files and contexts in a project.

This is the time taken by the XAML compilation task before and after this PR:

Project Before After Difference
Avalonia.Themes.Fluent 3.25s 2.59s -20.3%
ControlCatalog 7.17s 5.08s -29.1%

Performance improvements will vary by project, but should be most impactful for large projects.