This is lesson 5 of 12 in this module Course 87% complete

Demo: Benchmarking Arrays (part 1)

Premium Content

Sign in with your account or join us to access this lesson.

The lesson benchmarks filling a 5000 x 75000 element grid using a one-dimensional array, a flattened 1D array with manual offset, a jagged array, and a two-dimensional array, revealing that the 2D array is twice as slow as the 1D array due to the Array.Set overhead. We show that manual array flattening is only marginally slower than a native 1D array, making it the best alternative to true 2D arrays.