Henrik,

I'm not sure about the serialization itself but I noticed that you are

always doing the muti array first. Remember that spinning up objects

take time. When I ran your code, I got similar numbers, but when I

switched the call around to run the single array serialization first I

got these numbers:

Serialize single dim 3.1087183

Serialize multi dim 18.9803655

True, the multi is still higher, but not 10x higher.

Also, in your code to initialize the arrays, you make repeated calls

to GetLowerBound and GetUpperBound. These take time, lots of time. I

changed your code to store them off as temporary variables first:

for (int i = a; i <= x; ++i)

for (int j = b; j <= y; ++j)

for (int k = c; k <= z; ++k)

multiDimArray[i, j, k] = 0;

Console.WriteLine("Init multi dim " + (DateTime.Now -

start).TotalSeconds);

And I got this for the times:

Init multi dim 0.5155161

Init single dim 0.8904369

Now the multi is faster.

Hope any of this helps,

L. Lee Saunders

http://oldschooldotnet.blogspot.com