AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.22k stars 2.18k forks source link

[Perf] Avoid Cast in SceneBuilder.PropagateLayer #9604

Closed workgroupengineering closed 1 year ago

workgroupengineering commented 1 year ago

In follow lines https://github.com/AvaloniaUI/Avalonia/blob/bbd2cfaed4ad0516776c5c66efc5639abf7b4256/src/Avalonia.Base/Rendering/SceneGraph/SceneBuilder.cs#L447-L454

node.Children is IReadOnlyList<IVisualNode>, when foreach run, every item of Children is cast to VisualNode for retrieve the LayerRoot

kekekeks commented 1 year ago

Note that DeferredRendeer/SceneBuilder will be removed before 11.0 release