Reputation: 976
Currently I am writing the Xamarin.Forms UI in C# code.
Is moving to Xaml will improve the performance ?
For example: I have a page that takes up to 2 seconds to load - it uses tableview with 100 different cell Views.
Upvotes: 1
Views: 822
Reputation: 3217
XAML can be directly compiled into the intermediate Language.
XAMLC offers a number of a benefits:
It performs compile-time checking of XAML, notifying the user of any errors. It removes some of the load and instantiation time for XAML elements. It helps to reduce the file size of the final assembly by no longer including .xaml files.
XAMLC is disabled by default to ensure backwards compatibility. It can be enabled at both the assembly and class level by adding the XamlCompilation attribute.
As Rafael Moura states in the following quote - there shouldn't be a difference.
There is no difference between the screen be done in XAML or C #, when compiled the result is just a DLL (apk, app, xap) with the representation of the screen already pre-compiled, requiring only the JIT. The difference is only in the level of organization code and programming.
In my opinion you should always prefer XAML creating your UIs programatically in C#, as it is easier to maintain and organize.
Upvotes: 3