Skip to content

Add performance logging and suggestions to .NET MAUI rendering #28091

Open
@PureWeen

Description

@PureWeen

Description

Based on this issue, it is challenging to determine exactly where most of the rendering time is consumed on a page.

Key considerations include:

  • Adding hooks at specific points in the platform layout system to track the time spent during various rendering phases.
    • This idea is demonstrated in certain tests (see comment), but making it a first-class feature of the framework could provide additional insights.
  • Allowing each layout to log how long it takes to render.
  • Providing recommendations/warnings at runtime for optimizing less efficient execution paths.

Possible Points in time to measure

  • SetVirtualView (this tells us how long it takes to create the control and run all the initial mappers)
  • Measure
  • Arrange
  • InitializeComponent call to setup all bindings
  • Count every time calls are marshalled back to the Dispatcher to see if users are building up lot of calls to the dispatcher

Alternative Ideas

  • Don't provide fine grained performance details but possibly just general load times. Instead provide event hooks into areas of the app and users can log for themselves if they want to, or 3rd parties can create libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-architectureIssues with code structure, SDK structure, implementation detailsdelighter-scproposal/underconsiderations/triagedIssue has been reviewedt/perfThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions