Skip to main content
This is lesson 9 of 14 in this module Course 39% complete

Demo: Benchmarking Lists and Arrays

Premium Content

Sign in with your account or sign up 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.