Monday, April 24, 2006

per-ring curve decision benchmarks

Bottom line: The per-ring version (1.4.03) is very slightly faster than 1.4.02. The data shows a consistent improvement of between 5 and 10 microseconds per frame. This is the opposite of the expected result. Perhaps moving the curvature test into the main loop allowed the compiler to better optimize the initial pass (for trail)? It could also be a change in cache behavior.

#include "benchmark.h"
float sum;
int cnt;
void CWhorldView::Draw(HDC dc)
{
CBenchmark b;
.
.
.
sum += b.Elapsed();
cnt++;
if (cnt == 1000) {
CString s;
s.Format("%d %f %f\n", cnt, sum, sum / cnt);
AfxMessageBox(s);
}

total time (sum) in seconds for 1000 frames

default patch
1.4.02 1.4.03
--------------
1.448 1.436
1.448 1.436
1.442 1.435
1.442 1.439
1.446 1.440

default patch, speed and canvas scale at max
1.4.02 1.4.03
--------------
5.400 5.390
5.396 5.390

No comments: