Web site domain - CHAPTER 5 PERFORMANCE THROUGH THE APPLICATION DEVELOPMENT

CHAPTER 5 PERFORMANCE THROUGH THE APPLICATION DEVELOPMENT LIFE CYCLE Figure 5-9. Profiling the bubbleSort() method By profiling the bubbleSort() method, we see that 45 percent of its time is spent comparing items, and 25 percent is spent managing a for loop; these two lines account for 56 cumulative seconds. Figure 5-9 clearly illustrates the core issue of the bubble sort algorithm: on line 15 it executes the for loop 12,502,500 times, which resolves to 12,479,500 comparisons. To be successful in deploying high-performance components and applications, you need to apply this level of profiling to your code. Coverage Profiling Identifying and rectifying memory issues and slow-running algorithms gives you confidence in the quality of your components, but that confidence is meaningful only as long as you are exercising all or at least most of your code. That is where coverage profiling comes in; coverage profiling reveals the percentage of classes, methods, and lines of code that are executed by a test. Coverage profiling can provide strong validation that your unit and integration tests are effectively exercising your components. In this section, I ll show a test of a graphical application that I built to manage my digital pictures running inside of a coverage profiler filtered according to my classes. I purposely chose not to test it extensively in order to present an interesting example. Figure 5-10 shows a class summary of the code that I tested, with six profiled classes in three packages displayed in the browser window and the methods of the JThumbnailPalette class with missed lines in the pane below.
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision ecommerce web hosting services

Leave a Reply