question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate performance issues

See original GitHub issue

Android is slow when debugging (several seconds before displaying another screen), especially with Program.withConsoleTrace. We should find a way to speed things up a little.

Also in Release mode, Android (and maybe iOS) still feels a little slow.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:30 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
TimLarivierecommented, May 11, 2019

I’ve started to run some perf measurements to find bottlenecks in Fabulous.

If you’re interested, you can run your own tests with this branch : https://github.com/TimLariviere/Fabulous/tree/performance (ElmishContacts.Android won’t work for the moment – missing dependencies)

I use ElmishContacts as a reference, because that’s where I noticed some big slowdowns when navigating from page to page. This test has been run on an iPhone 5s simulator on a Mac Book Pro, so it’s supposed to be very good compared to an actual device.

For now, I’ve only tested navigation from the empty home page to the contact creation page.

Fabulous determines this is a new page and almost no control can be reused (except maybe the NavigationPage root) https://github.com/TimLariviere/ElmishContacts/blob/686d9598bc8a07dc52facb69dd1cfd4b111e7cb6/ElmishContacts/EditPage.fs#L206-L277

What I can see from the full log is that Fabulous is doing great almost everywhere, except on some controls.

  • let update msg model is done in approximately 8 milliseconds (I found also 1ms on another test)
  • let view model dispatch is done in 162 milliseconds (some improvements can be made here)
  • (Fabulous) canReuseChild is instantaneous (the whole page changed so it was expected)
  • (Fabulous) newPageElement.UpdateIncremental is done in 354ms

That last one is quite slow I think, given it ran on a powerful iOS simulator. It can easily take seconds on an actual low-end Android device.

Most of the controls are almost instantaneous. Only StackLayout starts to take a significant time (129ms), only to be top by NavigationPage (with 353ms, of which 129 is from StackLayout)

I will try to check what’s going on with the layout controls

Full log:

Update done in 8 ms / 80054 ticks View done in 162 ms / 1624492 ticks canReuseChild done in 0 ms / 237 ticks UpdateFuncElement done in 0 ms / 52 ticks UpdateFuncVisualElement done in 0 ms / 3917 ticks UpdateFuncPage done in 0 ms / 7043 ticks 2019-05-11 11:19:45.843428+0200 iOS[6571:163757] Updating NavigationPage, prevCount = 1, newCount = 2 Create Xamarin.Forms.ContentPage done in 0 ms / 492 ticks UpdateFuncElement done in 0 ms / 28 ticks UpdateFuncVisualElement done in 0 ms / 2910 ticks Create Xamarin.Forms.ToolbarItem done in 0 ms / 29 ticks UpdateFuncElement done in 0 ms / 35 ticks UpdateFuncMenuItem done in 0 ms / 3393 ticks UpdateFuncToolbarItem done in 0 ms / 9971 ticks UpdateFuncPage done in 2 ms / 23731 ticks Create Xamarin.Forms.ScrollView done in 0 ms / 8901 ticks UpdateFuncElement done in 0 ms / 31 ticks UpdateFuncVisualElement done in 0 ms / 4235 ticks UpdateFuncView done in 0 ms / 7919 ticks UpdateFuncLayout done in 1 ms / 11518 ticks Create Xamarin.Forms.StackLayout done in 2 ms / 27116 ticks UpdateFuncElement done in 0 ms / 34 ticks UpdateFuncVisualElement done in 0 ms / 2872 ticks UpdateFuncView done in 1 ms / 12802 ticks UpdateFuncLayout done in 2 ms / 25781 ticks Create Xamarin.Forms.Grid done in 1 ms / 19515 ticks UpdateFuncElement done in 0 ms / 39 ticks UpdateFuncVisualElement done in 0 ms / 4217 ticks UpdateFuncView done in 0 ms / 9077 ticks UpdateFuncLayout done in 1 ms / 12638 ticks Create Xamarin.Forms.RowDefinition done in 0 ms / 4102 ticks UpdateFuncRowDefinition done in 0 ms / 8092 ticks Create Xamarin.Forms.RowDefinition done in 0 ms / 13 ticks UpdateFuncRowDefinition done in 0 ms / 88 ticks Create Xamarin.Forms.ColumnDefinition done in 0 ms / 4617 ticks UpdateFuncColumnDefinition done in 0 ms / 2150 ticks Create Xamarin.Forms.ColumnDefinition done in 0 ms / 16 ticks UpdateFuncColumnDefinition done in 0 ms / 762 ticks Create Xamarin.Forms.Button done in 1 ms / 16358 ticks UpdateFuncElement done in 0 ms / 43 ticks UpdateFuncVisualElement done in 0 ms / 7102 ticks UpdateFuncView done in 1 ms / 13248 ticks UpdateFuncButton done in 7 ms / 71112 ticks Create ElmishContacts.Controls.BorderedEntry done in 1 ms / 12292 ticks UpdateFuncElement done in 0 ms / 43 ticks UpdateFuncVisualElement done in 0 ms / 4907 ticks UpdateFuncView done in 0 ms / 8838 ticks UpdateFuncInputView done in 1 ms / 16047 ticks UpdateFuncEntry done in 10 ms / 105434 ticks Create ElmishContacts.Controls.BorderedEntry done in 0 ms / 361 ticks UpdateFuncElement done in 0 ms / 36 ticks UpdateFuncVisualElement done in 0 ms / 9855 ticks UpdateFuncView done in 1 ms / 11964 ticks UpdateFuncInputView done in 1 ms / 14320 ticks UpdateFuncEntry done in 1 ms / 18076 ticks UpdateFuncGrid done in 71 ms / 718283 ticks Create Xamarin.Forms.StackLayout done in 0 ms / 351 ticks UpdateFuncElement done in 0 ms / 45 ticks UpdateFuncVisualElement done in 0 ms / 4901 ticks UpdateFuncView done in 1 ms / 10357 ticks UpdateFuncLayout done in 1 ms / 14169 ticks Create Xamarin.Forms.Label done in 0 ms / 435 ticks UpdateFuncElement done in 0 ms / 40 ticks UpdateFuncVisualElement done in 0 ms / 3545 ticks UpdateFuncView done in 0 ms / 6523 ticks UpdateFuncLabel done in 1 ms / 10166 ticks Create Xamarin.Forms.Switch done in 0 ms / 8581 ticks UpdateFuncElement done in 0 ms / 43 ticks UpdateFuncVisualElement done in 0 ms / 5115 ticks UpdateFuncView done in 0 ms / 9834 ticks UpdateFuncSwitch done in 2 ms / 23601 ticks UpdateFuncStackLayout done in 16 ms / 162795 ticks Create Xamarin.Forms.Label done in 0 ms / 265 ticks UpdateFuncElement done in 0 ms / 37 ticks UpdateFuncVisualElement done in 0 ms / 3189 ticks UpdateFuncView done in 0 ms / 6161 ticks UpdateFuncLabel done in 1 ms / 10001 ticks Create ElmishContacts.Controls.BorderedEntry done in 0 ms / 352 ticks UpdateFuncElement done in 0 ms / 27 ticks UpdateFuncVisualElement done in 0 ms / 2914 ticks UpdateFuncView done in 0 ms / 5467 ticks UpdateFuncInputView done in 0 ms / 8544 ticks UpdateFuncEntry done in 1 ms / 12167 ticks Create Xamarin.Forms.Label done in 0 ms / 237 ticks UpdateFuncElement done in 0 ms / 22 ticks UpdateFuncVisualElement done in 0 ms / 2877 ticks UpdateFuncView done in 0 ms / 5789 ticks UpdateFuncLabel done in 0 ms / 8578 ticks Create ElmishContacts.Controls.BorderedEntry done in 0 ms / 272 ticks UpdateFuncElement done in 0 ms / 25 ticks UpdateFuncVisualElement done in 0 ms / 3190 ticks UpdateFuncView done in 0 ms / 5928 ticks UpdateFuncInputView done in 0 ms / 8979 ticks UpdateFuncEntry done in 1 ms / 11921 ticks Create Xamarin.Forms.Label done in 0 ms / 154 ticks UpdateFuncElement done in 0 ms / 21 ticks UpdateFuncVisualElement done in 0 ms / 3347 ticks UpdateFuncView done in 0 ms / 5969 ticks UpdateFuncLabel done in 0 ms / 8901 ticks Create Xamarin.Forms.Editor done in 0 ms / 9492 ticks UpdateFuncElement done in 0 ms / 40 ticks UpdateFuncVisualElement done in 0 ms / 8508 ticks UpdateFuncView done in 1 ms / 13274 ticks UpdateFuncInputView done in 1 ms / 16243 ticks UpdateFuncEditor done in 3 ms / 32108 ticks Create Xamarin.Forms.Button done in 0 ms / 262 ticks UpdateFuncElement done in 0 ms / 38 ticks UpdateFuncVisualElement done in 0 ms / 5859 ticks UpdateFuncView done in 0 ms / 9736 ticks UpdateFuncButton done in 1 ms / 17127 ticks UpdateFuncStackLayout done in 129 ms / 1291587 ticks UpdateFuncScrollView done in 135 ms / 1359928 ticks UpdateFuncContentPage done in 148 ms / 1489594 ticks 2019-05-11 11:19:45.993460+0200 iOS[6571:163757] PushAsync, page number 1 UpdateFuncNavigationPage done in 353 ms / 3539693 ticks newPageElement.UpdateIncremental done in 354 ms / 3544155 ticks

0reactions
TimLarivierecommented, May 16, 2022

Performance has been drastically improved in v2 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Monitoring 101: Investigating Performance Issues
Monitoring 101: Investigating performance issues · 1. Start at the top with work metrics · 2. Dig into resources · 3. Did something...
Read more >
8.12 Investigation of Performance Issues
When an employee is having a performance issue, it is often the responsibility of the HR professional to investigate the situation. Training managers...
Read more >
Tips For Investigating Performance Issues - mohit.io
Reproduce The Performance Issue · Find A Build Or Change That Introduced The Issue · Use Release Builds Only · Use The Same...
Read more >
The Importance of Thoroughly Investigating Performance ...
Many organizations use progressive discipline for performance and attendance issues even with “employment at-will” language in their handbooks but will.
Read more >
Investigate performance issues with DPA
Investigate performance issues with DPA. DPA uses an approach called wait-based analysis to help you focus on issues that provide the greatest performance ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found