This is lesson 9 of 11 in this module Course 75% complete

Demo: Benchmarking Lists and Arrays

Premium Content

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

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.