This circuit has the property that it can stay

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: re one half of the time is spent performing lower-case conversion. We have already seen that function lower1 has very poor performance, especially for long strings. The words in this document are short enough to avoid the disasterous consequences of quadratic pe- 266 CHAPTER 5. OPTIMIZING PROGRAM PERFORMANCE formance; the longest word (“honorificabilitudinitatibus”) is 27 characters long. Still, switching to lower2, shown as “Linear Lower” yields a significant performance, with the overall time dropping to 0.52 seconds. With this exercise, we have shown that code profiling can help drop the time required for a simple application from 9.11 seconds down to 0.52—a factor of 17.5 improvement. The profiler helps us focus our attentionon the most time-consuming parts of the program and also provides useful information about the procedure call structure. We can see that profiling is a useful tool to have in the toolbox, but it should not be the only one. The timing measurements are imperfect, especially for shorter (under one second) run times. The results apply only to the particular data tested. For example, if we had...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online