views:

260

answers:

1

Hi,

In the Apress book "Illustrated C# 2008", pg. 343 notes:

"One-dimensional arrays have specific instructions in the CIL that allow them 
 to be optimized for performance.  Rectangular arrays do not have these
 instructions...Because of this, it can sometimes be more efficient to use
 jagged arrays..."

Does anyone know how these performance optimizations are implemented ?

Thanks,

Scott

+2  A: 

Read this article.
Note that it's written about version 1.0 of the CLR; I don't know how much has changed since.

SLaks
Thanks! One change appears to be that jagged arrays are now CLS compliant (see: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=94823), while the CodeProject document states: "...jagged arrays are not CLS-compliant...".
Scott Davies