I have a piece of code that iterates over a small list frequently. Given that the list never changes during runtime, I replaced the implementation with ImmutableList<T>
. Looking at a performance trace by dotTrace, this performs much worse than a normal List<T>
:
(
List<T>
on left, ImmutableList<T>
on right)
Why is this occurring and is there a workaround?