Using Performance Profiling to Improve Performance

Now you will use information in the Performance Profile viewer to determine if you can improve performance in the UMTS base station code.

To locate and fix performance bottlenecks:

  1. Select the Performance Profile tab.

  2. Within the table, left-click the column title Avg F Time (Average Function Time) in order to sort the table by this column. (You may want to scroll down the report a bit to view more data elements in the table.)

For this exercise you have sorted by the Average Function Time - that is, you're looking at functions that take, on average, the longest time to execute. This isn't the only potential type of bottleneck in an application - for example, perhaps it is the number of times one function calls its descendants that is the problem - but for this exercise, you will look here first.

As the developer of this UMTS base station, you would know that the C function tcpsck_data_ready() does take a fair amount of time to execute - so you won't look here first (although feel free to have a look if you wish). Instead look at a different function in the table.

  1. Select the link for the C function checkUmtsNetworkConnection()

A quick look at the source code shows you that the developer treated this as a dummy function, inserting a "time-waster" to make it appear as if the function were executing. Simply comment out the line.

  1. Change the code from

 doSomeStuff(1);

to

 // doSomeStuff(1);

  1. From the File menu, select Save

 

This way, the checkUmtsNetworkConnection() method will do nothing at all. The next time you perform the manual test, this C++ method should have an execution time of 0.

There is another UmtsServer class method that also needs to be improved. Have a look, if you wish.