This preview shows page 1. Sign up to view the full content.
Unformatted text preview: urn get_counter(); } Executing P once before starting the measurement will have the effect of bringing the code used by P into the instruction cache. The code above also minimizes the effects of data cache misses, since the ﬁrst execution of P will also have the effect of bringing the data accessed by P into the data cache. For procedures procA or procB, a measurement by time P warm would yield 100 cycles. This would be the right conditions to measure if we expect our code to access the same data repeatedly. For some applications, however, we would be more 466 CHAPTER 9. MEASURING PROGRAM EXECUTION TIME likely to access new data with each execution. For example, a procedure that copies data from one region of memory to another would most likely be called under conditions where neither block is cached. Procedure time_P_warm would tend to underestimate the execution time for such a procedure. For procA or procB, it would yield 100 rather than the 132 to 134 measured when the procedure is applied to uncached data. To force the timing code to measure the performance of a procedure w...
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.
- Spring '10
- The American