Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Generator Performance Improvements #19990

Merged
merged 4 commits into from
Jan 26, 2024
Merged

Commits on Jan 23, 2024

  1. Source Generator Performance Improvements:

    - Reversed lookup order (Extension second)
    - Introduced type cache
    
    ```
    PERF PROGRESS:
    SourceGen - Maui.Controls.Sample (262 XAML files)
    
    1) Unchanged:
    - 15640 GetTypeByMetadata calls
    - 223s
    
    2) Extensions lookup in XmlTypeXamlExtensions.GetTypeReference() second
    - 6232 GetTypeByMetadata calls (~60% reduction)
    - 90s                          (~60% reduction)
    
    3) With type cache
    - 203 GetTypeByMetadata calls (~97% reduction => ~99% total reduction)
    - 6s                          (~93% reduction => ~97% total reduction => 37 times faster!)
    ```
    mgoertz-msft authored and StephaneDelcroix committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    5ed4ea9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a7b2ce View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    58fc951 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2024

  1. Fixed the build break by putting Extension lookup first again to avoi…

    …d potentially breaking behavior for scenarios besides x:Array. In this case XamlC preferred System.Array over ArrayExtension for x:Array. With the typecache it made no measurable difference in performance.
    mgoertz-msft committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    1bc436e View commit details
    Browse the repository at this point in the history