Why is the ImmutableList <T> enumerator much slower compared to List <T>

I have a piece of code that is often repeated in a small list. Given that the list never changes at runtime, I replaced the implementation ImmutableList<T>. If you look at the dotTrace performance trace, this is much worse than normal List<T>:

dotTrace Result ( List<T>left, ImmutableList<T>right)

Why is this happening and is there a workaround?

+4
source share
1 answer

List<T>, , , ImmutableList<T> . Channel9, ).

, , ?

ImmutableArray<T>.

. NET Framework

:

  • (< 16)
  • , .

:

  • .
  • , .
+8

All Articles