S
Skybuck Flying
Hello,
When accessing a multi dimensional array it can be done in different index
orders for example:
// slow:
for x:=0 to 199 do
for y:= 0 to 199 do
for z:= 0 to 199 do
array[z,y,x] := ...;
// 4x times faster:
for x:=0 to 199 do
for y:= 0 to 199 do
for z:= 0 to 199 do
array[x,y,z] := ...;
Test system is AMD X2 3800+ with Windows XP x64 Pro Edition, Code compiled
with Borland Delphi 2006 Win32.
I read about different row and column access times for memory chips, and
some time ago somebody mentioned communication between cpu and processor is
faster for sequential memory access...I thought it was fun to write a speed
test program to investigate this. I wrote a test program to try out all
index order combinations for four and three dimensional arrays and there is
indeed a substantial timing difference.
More information on this would be nice...
Bye,
Skybuck.
When accessing a multi dimensional array it can be done in different index
orders for example:
// slow:
for x:=0 to 199 do
for y:= 0 to 199 do
for z:= 0 to 199 do
array[z,y,x] := ...;
// 4x times faster:
for x:=0 to 199 do
for y:= 0 to 199 do
for z:= 0 to 199 do
array[x,y,z] := ...;
Test system is AMD X2 3800+ with Windows XP x64 Pro Edition, Code compiled
with Borland Delphi 2006 Win32.
I read about different row and column access times for memory chips, and
some time ago somebody mentioned communication between cpu and processor is
faster for sequential memory access...I thought it was fun to write a speed
test program to investigate this. I wrote a test program to try out all
index order combinations for four and three dimensional arrays and there is
indeed a substantial timing difference.
More information on this would be nice...
Bye,
Skybuck.