This preview shows page 1. Sign up to view the full content.
Unformatted text preview: run the original function on data consisting of a smaller number of longer strings, we would have found that the lower-case conversion routine was the major performance bottleneck. Even worse, if only proﬁled documents with short words, we might never never detect hidden performance killers such as the quadratic performance of lower1. In general, proﬁling can help us optimize for typical cases, assuming we run the program on representative data, but we should also make sure the program will have respectable performance for all possible cases. This is mainly involves avoiding algorithms (such as insertion sort) and bad programming practices (such as lower1) that yield poor asymptotic performance. 5.15.3 Amdahl’s Law
Gene Amdahl, one of the early pioneers in computing, made a simple, but insightful observation about the effectiveness of improving the performance of one part of a system. This observation is therefore called Amdahl’s Law. The main idea is that when we speed up one part of a system, the effect on the overall system performance depends on both how signiﬁcant this...
View Full Document
- Spring '10
- The American