This preview shows page 1. Sign up to view the full content.
Unformatted text preview: y, rather than as some other data structure such as a linked list. A more pragmatic programmer would argue the advantage of this transformation based on the following experimental results: Function combine2 combine3 Page 212 217 Method Move vec length Direct data access Integer + * 20.66 21.25 6.00 9.00 Floating Point + * 21.15 135.00 8.00 117.00 There is a improvement of up to a factor of 3.5X. For applications where performance is a signiﬁcant issue, one must often compromise modularity and abstraction for speed. It is wise to include documentation on the transformations applied, and the assumptions that led to them, in case the code needs to be modiﬁed later.
Aside: Expressing relative performance. The best way to express a performance improvement is as a ratio of the form ÌÓÐ ÌÒ Û , where ÌÓÐ is the time required for the original version and ÌÒ Û is the time required by the modiﬁed version. This will be a number greater than 1.0 if any real improvement occurred. We use the sufﬁx...
View Full Document
- Spring '10
- The American