Pre-sizing Lists
The lesson explains the internal doubling-expansion algorithm that generic List uses when capacity is exhausted, and how pre-allocating capacity with the constructor's int parameter eliminates those copy operations. We discuss when pre-sizing is worth the effort and introduce arrays as the fastest alternative when the element count is known in advance.
Previous Module
A Crash Course In Intermediate Language
This Module
Basic Performance Optimizations