Skip to content

perf(generator): share semantic models per source file - #169

Merged
glennawatson merged 1 commit into
mainfrom
perf/share-semantic-model-per-tree
Oct 4, 2026
Merged

glennawatson merged 1 commit into
mainfrom
perf/share-semantic-model-per-tree

Conversation

@glennawatson

@glennawatson glennawatson commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Views with many XAML bindings rebuild faster.

  • Reuse semantic models per source file.
  • Add regression tests and XAML benchmarks.
  • Add a benchmark comparison table.

Why

XAML bindings repeatedly bound the same activation lambda.

Closes #166.

Breaking changes

None.

How this was verified

Tests cover model reuse, isolation, parallel reads and generated code.
Ran benchmarks, v2rayN rebuilds, desktop examples and the Native AOT sample.

Notes for the reviewer

Review the cache lifetime in CallSiteContext.ModelFor.

Checklist

  • I have read the Contribute guide
  • The PR title follows Conventional Commits
  • Tests cover this change, or the summary says why they do not
  • New or changed public API has XML documentation

- Reuse bound members across call sites in a compilation copy.
- Add regression coverage for model reuse.
- Measure XAML view generation across binding counts.
@glennawatson
glennawatson enabled auto-merge (squash) October 4, 2026 04:27
@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.28%. Comparing base (b0c70a0) to head (6233643).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #169   +/-   ##
=======================================
  Coverage   99.28%   99.28%           
=======================================
  Files         403      403           
  Lines       15028    15033    +5     
  Branches     2227     2229    +2     
=======================================
+ Hits        14920    14925    +5     
  Misses        108      108           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@glennawatson
glennawatson merged commit 05c45ce into main Oct 4, 2026
23 checks passed
@glennawatson
glennawatson deleted the perf/share-semantic-model-per-tree branch October 4, 2026 04:29
glennawatson added a commit that referenced this pull request Oct 4, 2026
- Reuse bound members across call sites in a compilation copy.
- Add regression coverage for model reuse.
- Measure XAML view generation across binding counts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: BindingGenerator spends ~20 s per compile of an Avalonia app with ~470 bindings

1 participant