For any application to be a successful one, there is one inevitable factor which should not be compromised. That is the ‘performance’ of an application. Though it is quite tricky to explain what performance is all about, I will try to keep it short and simple to give a glimpse about the best practices one might follow to improve the performance of any Windows 8 application.
Performance from user’s View
Like for example, when an application is started, it’s very important to handle the Active Time (The duration between when the application is started to when the initial page is actually displayed). This time makes the first impression to the user about the performance of the application. At this point, instead of just leaving the user without knowing what is happening, a Splash screen can be displayed with the application name or Logo. This actually does more than what it sounds to be. This makes a user to understand the application is in progress, also giving them a way to ensure that they have opened what they wanted to.
• Try to reduce the time between activities that the user needs to perform to accomplish their task.
• Make sure that anytime you need to ask the user questions or have them provide info that you are asking all of the questions up front.
• Suspend the application instead of closing it, so that every time the user need not wait for the application to load.
• Separate out user activities into multiple periods with some time in between.
General best practices to improve the performance
A. Starting off with the performance plan
One of the points that need to be considered before start developing an application is, understanding its critical areas where the performance might lack. This process should take place at the very early stage of the app life cycle. You don’t need to completely understand the platform to reason about where you might need to improve performance. By knowing what parts of your code execute most frequently, you can determine the best places to optimize your app.
B. Testing the applications on low-power devices
When you develop an application, always keep in mind that the user might not use the computer that you use as part of the development. The user might use a low-power device such as tablet or smartphone. Operations that seem to run fast on your development machine can have a big impact to the user-experience on a low power device. So it is up to the developer’s responsibility to aim the application’s performance from such devices. A simple solution being, expecting that a low power device is about 4 times slower than a desktop computer and hence set your goals accordingly.
C. Reduce Memory & Battery consumption
At times you might have to think beyond just the user experience. You also have to consider other factors that don’t have a direct impact on the user experience. One of those factors is memory consumption. When an app uses large amounts of memory, it takes it from the rest of the system, causing the system as a whole to appear very slow. This usually occurs when an application tries to load the resources which are too large for the target device. The best practice is to use Thumbnail APIs to extract the resources appropriate for the target resolution thereby avoiding unnecessarily overhead to the memory.
On the other hand, the CPU is a major consumer of battery power on devices. Windows 8 tries to keep the CPU in a low power state when it is idle, but activates it every time you schedule work. You can further reduce your app’s consumption of battery power by ensuring that your app doesn’t have timers unnecessarily to schedule work on the CPU when it is idle. For example, an app might poll for data from web services and sensors (such as the GPS). Consider battery consumption when deciding how often your poll for data.
• Try to use as few resources as possible while idle
• Try running the audio, animations when idle
• Perform disk-intensive operations like device sync and file caching when idle
D. Monitoring the performance
The best way to improve the performance of your windows 8 application is to monitor how it responds to the user requests. One of the best techniques for determining the responsiveness of the application is to perform app profiling. Profiling gives data on how much time your app consumes in its various functions, so you can see the spikes where the app is doing most of its work. Luckily, there is a great profiling tool available in Visual Studio 11 that you can access on the Windows 8 Consumer Preview. As I mentioned earlier, do keep in mind that performance measures on high level devices need not to be same on the low-power devices.
You may be an enterprise/company/organization working behind windows 8 mobile application development, its now possible to release your windows phone 8 apps to your connected users without queuing in windows marketplace. Interesting stuff you will be loved to read through.
Leave a Reply