Exercise 1.5: Resolving the performance bottleneck

Before you begin, you must complete Exercise 1.4: Checking code coverage.

You have now checked the code coverage and found that the method quickFast was not executed. You will use this information to find and resolve the performance bottleneck.

To open the code for editing and resolve the bottleneck:

  1. Refer again to the Performance Call Graph, and check the call path to quick. You will see that main calls Qsort and Qsort calls quick. It will be a good idea to look at Qsort to see why quick was called and quickFast was not called.
  2. Right-click Qsort and select Open Source.
    The Software Development Platform switches to the Java perspective, and displays the Sort.java file in the Java editor, at the location of the Qsort method.
  3. Read the comment that is located immediately after the Qsort method. The comment gives instructions for having the application execute quickFast instead of quick.
  4. Follow the instructions in the comment and modify your code.
  5. Select File > Save to save your changes.
  6. Select Run > Profile..., and then click Profile.
  7. Check the Performance Call Graph, and note that the quick sort is now much faster than the bubble sort.
  8. Check the Coverage Details views, and verify that it shows that quickFast has been covered in this run.

You have now fixed the bottleneck, and verified that it is no longer a problem. Finish your tutorial by reviewing the materials in the Summary.

Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.