Topic 4 · Class activity 5 · Week 11 · Wednesday

Measure It, and Defend the Number

Code size and work done are different numbers. Get both, repeat the run, and state a threshold you can justify.

Format pairs, at a laptopTime 50 minNeed SPIM, and your machine's specifications

The point

Produce a number you would be willing to defend to someone who wanted to disagree with it.

Do this

  1. Write a benchmark with a hot nested loop running a few thousand iterations.
  2. Code size. Record the TAC instruction count before and after optimization, plus the per-technique scorecard.
  3. Work done. Run both versions in SPIM and record instructions executed. To get an unoptimized .s, point the back end at the unoptimized list.
  4. Put the four numbers in a table and compute both percentages. They will not match — explain the gap in one sentence, in terms of what was inside the loop.
  5. Repeat three times. How much do the numbers move? Anything smaller than that spread is not a result.
  6. State a threshold. Given your machine and your measured noise, what reduction would you call significant? Justify it with the spread from step 5, not with a feeling.

Deliverable

A results table with all four numbers and both percentages; three repeated runs with the spread; the benchmark source; and a defended threshold. This is Lab Question 22 and a large part of the Project 6 performance section — do it properly now and reuse it in December.