By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 765 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

Jagged arrays question

P: n/a
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
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
<James dean <James dean>> wrote:
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?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2

P: n/a
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
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3

P: n/a
<James dean <James dean>> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.