06 Profiling
06 Profiling
Lecture 6
• Amdahl's Law
– The performance improvement gained from using some faster mode of
execution is limited by the fraction of the total time the faster mode can be
used
• Example:
Optimizable
2x Speedup
Unoptimizable Unoptimizable
b: b:
t6 = 4 * i t6 = 4* i
x = a[t6] x = a[t6]
t7 = 4 * i t8 = 4 * j
t8 = 4 * j t9 = a[t8]
t9 = a[t8] a[t6] = t9
a[t7] = t9 a[t8] = x
t10 = 4 * j goto b
a[t10] = x
Before After
goto b
t4 = 0 t4 = 0
label_XXX label_XXX
j = j + 1 t4 += 4
t4 = 4 * j t5 = a[t4]
t5 = a[t4] if (t5 > v) goto label_XXX
if (t5 > v) goto label_XXX
Before After
Dout[31:0] Data[31:0]
RAM