Over a million developers have joined DZone.

13 Ways to Improve the Performance of Your App

DZone's Guide to

13 Ways to Improve the Performance of Your App

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

There are lots of ways you can improve the performance (and the perceived performance) of your app.
This is not a complete list, just what came to mind right now.

The important (though unfortunate) thing to take from this is that great performance doesn't come easily and there are lots of things you can (or have to) do to give your users an awesome experience.

Note that some MVVM purist may dispute some of these but they're based on real world experience.

  1. Get off the UI thread - Don't use it when you don't have to. Keep the UI responsive.
  2. Don't use value converters - They have a much greater performance impact than direct properties.
  3. Don't use dependency properties when you don't need to - If regular properties will work for your needs then keep it simple as they're much faster to read
  4. Have fewer external dependenices - Loading fewer third party libraries saves time
  5. Split up your assemblies - Don't load all the pages (and code) in your app when you don't need to
  6. Cache images (and data) - Downloading external resources takes time. Don't repeat it unnecessarily. The same goes for processing or reformatting data.
  7. Use a "boot loader" - If you have a large app or a complicated start up process, only have the bare minimum in the app and push everything else to separate assemblies. This will help you get as animated loading page up as quickly as possible.
  8. Preload/prefetch data - If you can, get the data before you need it so that when you do need it the user doesn't have to wait.
  9. Lazy load data - If there is a large amount of data, only load it as you need it. Don't waste time forcing your user to wait while it's all loaded.
  10. Reuse [data] templates (load less xaml) - Loading fewer templates is faster. Make sure you don't reload the same ones repeatedly
  11. Have less XAML - Don't use any more XAML than you need to. I often see slow apps which have unnecessarily complicated, nested controls when the same thing coudl have been created with fewer controls.
  12. Avoid nested margins - Reduce the amount of work the loyout engine has to do measuring the elements in creates.
  13. Don't use XAML - Yes, it's extreme but you can get better performance from a UI created in code than in XAML (you save the parsing time) This can make supporting the code and making changes harder though.

The above has helped me in the past. Hopefully it may help you too.

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.


Published at DZone with permission of Matt Lacey, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}