L48 movl edxecx movl edxedx addl 4ecxeax testl

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: ng to lower case. 264 CHAPTER 5. OPTIMIZING PROGRAM PERFORMANCE 10 9 8 7 6 5 4 3 2 1 0 Initial Quicksort Iter First Iter Last Big Table Better Hash Linear Lower CPU Secs. . Rest Hash Lower List Sort (a) All versions. 2 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 Quicksort Iter First Iter Last Big Table Better Hash Linear Lower Rest Hash Lower List Sort . CPU Seconds (b) All but the slowest version. Figure 5.37: Profile Results for Different Version of Word Frequency Counting Program. divided according to the different major operations in the program. Time is 5.15. IDENTIFYING AND ELIMINATING PERFORMANCE BOTTLENECKS Hash Computing the hash function. Rest The sum of all other functions. 265 As part (a) of the figure shows, our initial version requires over 9 seconds, with most of the time spent sorting. This is not surprising, since insertion sort has quadratic complexity, and the program sorted nearly 27,000 values. In our next version, we performed sorting using the library function qsort, which is based on the quicksort algorithm. This version is labeled “Quicksort” in the figure. The more efficient sorting algorithm reduces the ti...
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