The log2 function is slow. But this is not the issue; calling it
in the hot path is the real (performance) issue.
The appended precomputes frequently-used values to avoid computing
them in the hot path. This results in a lot less instructions
executed, and a significant increase in performance.
The log2 function is slow. But this is not the issue; calling it in the hot path is the real (performance) issue.
The appended precomputes frequently-used values to avoid computing them in the hot path. This results in a lot less instructions executed, and a significant increase in performance.
This closes issue #46: simulation performance.
Before the patch:
Performance counter stats for './DRAMSim -t traces/k6_aoe_02_short.trc -d ini/DDR3_micron_16M_8B_x8_sg15.ini -s system.ini.example -c 10000000' (3 runs):
120,280,797,002 instructions # 2.05 insns per cycle
0.11 stalled cycles per insn ( +- 0.00% ) [83.33%]
After:
Performance counter stats for './DRAMSim -t traces/k6_aoe_02_short.trc -d ini/DDR3_micron_16M_8B_x8_sg15.ini -s system.ini.example -c 10000000' (3 runs):
Signed-off-by: Emilio G. Cota cota@braap.org