DotNETWeekly-io / DotNetWeekly

DotNet weekly newsletter
MIT License
198 stars 3 forks source link

【文章推荐】.NET 8中的Frozen Collection介绍 #679

Closed tonyqus closed 1 day ago

tonyqus commented 3 weeks ago

image

In .NET 8, Frozen Collections are new collections that provide a unique level of performance optimization.

Currently, we have 𝗙𝗿𝗼𝘇𝗲𝗻𝗦𝗲𝘁 and 𝗙𝗿𝗼𝘇𝗲𝗻𝗗𝗶𝗰𝘁𝗶𝗼𝗻𝗮𝗿𝘆.

Once a collection is frozen, it becomes immutable, making it ideal for scenarios where the collection is initialized once and remains unmodified.

But how does it differ from immutable collections such as ImmutableHashSet and ImmutableDictionary?

gaufung commented 1 day ago

Duplicated