Forum Xamarin.Forms

Add switch to turn on App/UI load timing log messages (to be used to improve load performance)

Summary

Currently it is rather difficult to understand why (specifically under Android, but iOS as well), application startup takes a long time.
It would be very useful to enable time stamped logging for the major steps of UI creation as well as instance creation of the individual elements in the view hierarchy.

e.g. If I have a compiled XAML page which contains a Grid with several images as children, the log messages would include:
1. creation start time of the grid
2. creation start and end times of the images
3. creation end time of the grid

To make these log messages more usable, they could be indented based on the view hierarchy depth of the element that is being logged. Also, if an element has x:Name property, then the name can be included in the log message.

This should work for compiled and non-compiled XAML, and probably also for manual UI element creation (to cover all patterns).
Since these messages will clobber debug output, a switch would be used to enable them only when the developer needs to understand/improve load performance issues.

API Changes

none needed?

Intended Use Case

Get better understanding of application startup bottlenecks in order to simplify process of profiling and speeding up application startup times.

Tagged:

Open · Last Updated

Posts

  • PhilipGruebelePhilipGruebele USMember ✭✭

    Alternatively, this information could be provided through the profiler. I have not used the profiler in a while but it does not appear to be possible to easily visualize this specific information there.

Sign In or Register to comment.