You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Uno source generators: migrate heavy legacy ISourceGenerators to cache-friendly incremental pipelines #24204
Uno's heavy generators (XamlCodeGenerator, DependencyObjectGenerator, BindableTypeProviders*, RemoteControlGenerator, NativeCtorsGenerator, …) are legacy ISourceGenerator, which re-run fully on every compilation. Under Hot Reload every edit triggers a full re-generation + recompile → ~70 MB transient allocation per edit on a real app for a ~150 KB delta (measured).
Mini-repro (edit of a file unrelated to the generator, per edit):
Generator
re-runs / edit
alloc / edit
legacy ISourceGenerator
1 (full)
~0.6 MB
cache-friendly IIncrementalGenerator
0
~0.03 MB (~20x less)
IIncrementalGenerator with .Combine(CompilationProvider)
1 (full)
~0.6 MB (== legacy)
Important caveat (perf != mechanical conversion). The win only materializes if the pipeline is cache-friendly: equatable value models, no Compilation/ISymbol captured in the pipeline hot path. Roslyn docs "Authoring a cache-friendly generator" and dotnet/roslyn Discussion #67469 confirm .Combine(CompilationProvider) defeats caching (the Compilation changes on every keystroke → full re-run). Note XamlCodeBehindGenerator already uses .Combine(context.CompilationProvider) — converting it naively would gain nothing.
Proposal: rewrite the hot-path generators as incremental with equatable extracted models; audit existing incremental generators for the CompilationProvider trap.
Activity