Jagged arrays question

  • Thread starter Thread starter James dean
  • Start date Start date
J

James dean

I have created algorithms in C# unsafe code and have fixed the arrays in
memory for optimum performance. I use multidimensional arrays rather
than jagged arrays. The algorithms i use usually read a bitmap file
sequentially so no random accessing different parts of the array. I know
in microsoft site it says to use jagged arrays but in this case with
reading a sequential file the performance difference will not be as good
as a multi-dimensional array
 
I have created algorithms in C# unsafe code and have fixed the arrays in
memory for optimum performance. I use multidimensional arrays rather
than jagged arrays. The algorithms i use usually read a bitmap file
sequentially so no random accessing different parts of the array. I know
in microsoft site it says to use jagged arrays but in this case with
reading a sequential file the performance difference will not be as good
as a multi-dimensional array

Possibly - you'd have to try it.

Do you have an actual question?
 
The question is...if i am always reading from an array sequentially and
assigning values will jagged arrays still outperform multidimensional
arrays?.

Thanks in advance
 
The question is...if i am always reading from an array sequentially and
assigning values will jagged arrays still outperform multidimensional
arrays?.

Well, the easiest thing would be just to try it. I suspect it still
would be faster, yes. However, whether it would be *significantly*
faster is a whole different question, and that depends on your app. It
shouldn't be too hard to try it both ways and time it.
 
Back
Top