Demo: Benchmarking Lists and Arrays
We runs a BenchmarkDotNet comparison of ArrayList, generic List, pre-sized List, and a one-dimensional integer array filling one million elements, revealing an ArrayList penalty of 50x and a two-millisecond advantage of arrays over pre-sized lists. The lesson discusses when the small array advantage justifies dropping the convenience of the list class.
Previous Module
A Crash Course In Intermediate Language
This Module
Basic Performance Optimizations