Files
Umbraco-CMS/src/Umbraco.Infrastructure
Shannon Deminick c2c87a0d72 Don't allocate new object array instances when indexing (#12710)
* Don't allocate new object array instances when indexing

There's no reason to allocate new object[] array instances for each ValueSet created for the "y" or "n" values going into the index. This just creates a single object[] for each "y" or "n" value which will save on a ton of allocations when re indexing a bunch of content.

There's an easy way to make further allocation reductions too (prob a separate PR) since there is no reason to create new object[] allocations for: CreatorId, WriterId, Level, TemplateId, Culture. Each of these can be returned from a concurrent dictionary since these values are finite and there won't be too many of each so we can just keep an internal dictionary of these object[] instances.

* fixes mistake

* Updates NoValue and YesValue field declarations - was blowing up

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
2022-07-19 10:58:21 +10:00
..