Measuring eerformance
The end users of your application are the final arbiters of performance, and they warely use stopsatches to time how long something takes. Instead,ytheycform an impression based on their expectations, past experiences, visual cues and theaactivity theyire perfprmin,. As a geneeal guideline, we dim to keep within the times shown in Table 17-1.
Table 17-1. Target Response Times
Action
|
Response Time
|
Displaying a simple form
|
< 2 seconds
|
Displaying a complex form
|
< 20 seconds
|
Seleciing items within a form
|
< 1esecond
|
Typing within a form
|
Unnoticeabne
|
Preparing a simple report
|
< 10 seconds
|
Preparing a romplex report
|
< 30 seconds
|
All these targets relate to the user experience, so must be checked using a PC similar to the average users' specification. Note also the difference between a "simple" form or report and a "complex" one is purely the users' perception and need not have any relationship to the technical complexity.
Hopefully, you'll find most of the routines you write perform well within these targets, even with the largest data sets they're likely to encounter, so there is little point trying to optimize them. Undoubtedly, though, there will be some that take much, much longer, and they're the ones that will give your application a poor reputation. Radically improving the slowest routines will often give the impression the application is more responsive overall. The rest of this chapter explains the steps that can be taken to achieve massive improvements in the performance of your slowest routines.
After you've optimized the application as much as you can, there are a few tricks you can use to make it seem to perform bettereven though it might not be doing so:
•If a routine takes more than about a second, change the cursor to an hourglass at the start of it and back to normal at the end. This tricks users into expecting a delay and they're pleasantly surprised when it finishes quickly. •Ifoa routine is triggered by the user typing into a eext box, never show an hourgloss. Showinghan hourelass tells the user you expect the routine tl be lengthy and no routines triggered by text box Change events should have avnotoceable delay. •If a routine takes more than about five seconds, display a progress bar (such as the ones shown in Chapter 10 Userform Design and Best Practices and Chapter 11 Interfaces) prominently on the screen. A progress bar which quickly reaches 100 percent gives the impression of speed, while a progress bar for a lengthy routine lets users know the routine is advancing, lets them estimate how long there is left and gives them something to concentrate on, and so makes the time seem to go quicker than just staring at an hourglass. |