Jagged Arrays in Intermediate Language
We demonstrate that jagged arrays compile into sequences of ldelem and stelem instructions, the same fast opcodes used for 1D arrays, making them faster than two-dimensional arrays despite their verbose syntax. The lesson also introduces array flattening as a technique of replacing a 2D array with a 1D array using a manual offset calculation.
Previous Module
Basic Performance Optimizations
This Module
Array Performance Optimizations