Bug 22149 - Poor performance while creating new Page on iOS devices.
Summary: Poor performance while creating new Page on iOS devices.
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.2
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-17 08:27 UTC by nayzak90
Modified: 2016-03-16 12:19 UTC (History)
6 users (show)

Tags: ios performance
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description nayzak90 2014-08-17 08:27:34 UTC
I didn't get any comments on forum thread http://forums.xamarin.com/discussion/21671/pushasync-and-delay

All my tests are on iPod Touch 5gen, iOS 7.1. On iOS Simulator everything fine.

First of all problem is in XAML. If xaml file is a little bit "complex" (in my case it's just about 80 lines of code with scroll view, stack layouts, labels, buttons and images), than it takes some time to parse it. For example, if I'm not binding any data to view and my ContentPage without any content, then page pushes immediately. But when I put content (see above), than I notice a small delay. So why xaml files are parsing on fly? Why they are not compiled?

Secondly, why bindings are so slow? I played around my problem with delays and found out that bindings are harmful for performance. Example. If I set up binding context with instantiated constant data (strings for labels and images urls) before InitializeComponent() is called than delay is very noticeable and worsens user experience. If I instantiate bindable data after instantiating of view components than page pushes with expected speed (don't forget about delays on "complex" xamls) but after page pushed components are rendered with default data and after about a 50-100ms components takes they binding data. And I don't know what is more ugly: forcing user to wait before new page will appear with rendered data or show him blank page which will render data without any animation.

Videos:
1 - Setting BindingContext with instantiated data after InitializeComponent() and before PushAsync()
http://youtu.be/k2I2vTGbH8I

2 - Setting BindingContext with instantiated data before InitializeComponent() and before PushAsync()
http://youtu.be/qUufFT1vEm8

3 - Setting BindingContext with instantiated data after InitializeComponent() and after PushAsync()
http://youtu.be/SQxjfdoNFRI

4 - BindingContext not set
http://youtu.be/Ef5a_EX1wwY

5 - Setting BindingContext with instantiated data after InitializeComponent() and before PushAsync(). No XAML. Just Label in ScrollView. Labels TextProperty is binded.
http://youtu.be/MEGd8aYNO_E
Comment 1 Rui Marinho 2015-05-29 11:24:01 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue we would very much appreciate it. We monitor recently touched NEEDS INFO bugs so we’ll notice you attached the reproduction we’ll take it from there. 

Warm regards,
Xamarin Forms Team
Comment 2 Jason Smith [MSFT] 2016-03-16 12:19:11 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we no longer believe it affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team