DEVELOPERS BLOG

Improving the Start-up Time of Your Networked App

We’ve spoken again and again about how to improve the start-up time and performance of your Cascades applications. We all know that users want responsive apps.

Today I want to highlight a small change that can shave hundreds of milliseconds off the startup time of your network-connected application. Many applications set up their UI first and then start their network requests later in the execution sequence. This is not the optimal approach, as loading the QML files needed for the UI can be a time-consuming activity. A better approach is for an app to perform its network requests before setting up the UI; then those tasks can execute in parallel.

To learn more about this technique, and see the data analyzing the time saved with this change, check out Peter Hartmann’s Knowledge Base article on Improving the Start-up Performance of Cascades apps.

This idea of starting app execution with network requests is expanded in Peter’s article on Pre-Connecting to a Web Server. BlackBerry 10.2 developers have the option to connect to a web server before sending an HTTP(S) request. This is helpful when the network request requires your app to read credentials, like an OAuth token, from storage.

And finally, if your app connects to a web service over SSL, take a look at Peter’s article on Re-Using SSL Sessions in Cascades apps. He shows you how your app can save time on startup by persisting SSL sessions via TLS session tickets. Re-using a TLS/SSL session has the benefit of saving one network round trip of the SSL handshake. This could result in your app being able to display content 200-300 milliseconds faster! This feature is available as of BlackBerry 10.2.

Let us know if implementing these methods helped you speed up your launch times!

About erahnen