Capturing Performance Requirements for Desktop applications
The common performance objectives for desktop applications are as follows:
- UI Responsiveness: No matter what you do never let the UI hang or be non responsive for the user. I would call this as perceived performance where the end user sees the UI as being continuously responsive. If you are performing a blocking operation which is also a long running one then showing a status bar helps rather than just showing a hung application with the sand clock icon.
You should quantify this objective at an application level rather than a use case level. The attribute can be quantified in Not to Exceed terms. For example, you may decide that the application should not be non responsive for more than say 2-4 seconds no matter what the use case is. - Number of screen hops to complete a use case: This is another attribute which comes in perceived performance category rather than being based on the machine resources on which the application is installed. If an application requires multiple nested dialog boxes to complete a single use case this might be taken as a negative factor by the end user for the performance. The screen flow for any use case should be kept to as minimal as possible without increasing the screen complexity.
You should quantify this attribute at application level rather than use case level. This attribute can be quantified in Not to Exceed terms. For example an architect may decide that the screen flow should not exceed 3 nested dialog boxes for any use case. - Private Bytes: This is the amount of bytes which have been allocated to the process and cannot be shared with any other process. Keep in mind that memory is a shared resource on a desktop. If available you can also do the benchmark analysis of the existing applications so as to set a target for yourselves. The guidelines for setting the threshold limit for this objective are very subjective. It depends upon various parameters like :
Who is the target end user? : A developer who shall be working on a high end machine or a normal home user. It makes a lot of difference because a developer shall most probably be powered by a high end machine with ample physical memory as compared to a home user. You need to remember that the application you are developing will co-exist and ‘co-run’ with other applications and hence share the total available memory.
What is the type of application you are developing?: If you are developing an application which constantly demands user attention and simply cannot work in background then it has kind of a distinct advantage as it may be allowed to hog more memory as compared to an application which is running as a windows service in the background.
How critical is the application for an end user?: If the application is critical to the end user he/she would not mind it gobbling up most of the desktop resources. However, if the application is just among the mob of others fighting to co-exist and co-run on the desktop then you better make sure that the application consumes minimum memory possible. Consider the example of Microsoft Word. When the user has it opened up and is busy typing something, it is among the top memory hoggers on the desktop. The user tolerates this (he does not have any other option in Microsoft worldJ) because he/she is actually busy using the application and chances are he/she is not working on anything else. However, it would be obscene for any windows service which runs in the background to dare gobble up such large amounts of memory in the form of private bytes. Therefore you should keep in mind what is the nature of application and how critical it is to the user.
Do you perform any I/O operations? Applications performing I/O activity (Disk I/O or Network I/O) may need to allocate buffers for storing of data. This affects the private bytes consumed by the application. This factor is significant in server applications but nevertheless needs should be considered for desktop applications too. - CPU cycles: Like memory processor is again a shared resource. Almost all the rules mentioned above for memory apply to processor utilization too. For desktop scenarios it is safe to assume a single processor desktop and allocate CPU budget for the application. Depending upon the criticality of the application you need to set the performance objective for the allowed CPU cycles. For example, if the application is supposed to run as a back ground service you may decide not to hog more than 20 % of CPU at any point of time. However, if your application is supposed to one of the critical ones running on the desktop you may decide to up the limit. A good example would be of a user playing music while working on a desktop. He/she may not like the fact the music application is hogging more than 70% of the CPU. However, a disc jockey creating fusion music may not bother even if most of the CPU cycles are consumed by the music application.
The important consideration for setting the limit of the CPU cycles again is the deployment scenario. An important difference between Private Bytes and CPU Cycles is that you need to set the limit on both the application level as well as the use case level explained below:
Application level: The application level limit can be set in either Not to Exceed terms or as a general figure which is applicable to most of the use cases. There may be certain use cases which may exceed this set limit because of their nature of computation. If there are any processor intensive use cases then they may deserve to exceed the limit set for the application.
Use Case level: As explained above, there may be certain use cases which may deserve to breach the application limit. You need to limit the breach levels for these use cases too.
In my next blog entry I shall write about the objectives which should be captured for server applications like a web service, ASP.NET web application, COM+ Server etc.
