ImmutableArray<T> already has special treatment in collection expressions world, e.g. [] is lowered as ImmutableArray<T>.Empty. However, construction of an array of 1-4 elements, which is most common in practice, creates an array and then wraps it into an immutable array via ImmutableCollectionsMarshal.AsImmutableArray(array). From performance point of view this is totally fine since we allocate the resulting array only once, but from the IL size point we can do better and use predefined ImmutableArray.Create factory methods, which exist for creating arrays of 1-4 elements without params array or any other overhead. This is a super trivial change that won't require much work
ImmutableArray<T>already has special treatment in collection expressions world, e.g.[]is lowered asImmutableArray<T>.Empty. However, construction of an array of 1-4 elements, which is most common in practice, creates an array and then wraps it into an immutable array viaImmutableCollectionsMarshal.AsImmutableArray(array). From performance point of view this is totally fine since we allocate the resulting array only once, but from the IL size point we can do better and use predefinedImmutableArray.Createfactory methods, which exist for creating arrays of 1-4 elements withoutparamsarray or any other overhead. This is a super trivial change that won't require much work