I started trying to set the initial size of some of my .NET collections when we know some expected maximum sizes. Think of pre-caching static data, etc.
If we start adding items to this collection later, the collection will resize to fit these new items. How to determine what the next size will be? I thought that if we use the default logic and do not set the initial size, it will resize based on some pre-encoded logic. Now, when we set the initial size, this screw, which is logically installed?
Is it simplified, and some kind of mathematical formula like current size + 10%or something?
source
share