Nu
Nu copied to clipboard
_ContentsOpt Fields Could Theoretically Thrash LOH
I think fields like EntityContentsOpt could thrash the LOH if they are filled with enough entries.
This is an unlikely circumstance in practice, but it's also hard to prevent in all possible cases since the fields use the OrderedDictionary type for which no Segemented variant is available.
Perhaps it time to see if we can come up with a way to segment OrderedDictionary? I guess it would work if it could only be appended to rather than removed from. Or maybe we could make a segmented one from scratch, who knows.
Or, maybe this is such an unlikely thing to happen in practice it's not worth addressing.
For now, we could put an assert on the size of them to notify the user of performance degradation if it ever hits a potentially problematic load.
Assert added as Log.warnOnce.
I think an assert is good enough for now here. Potentially reopen if people start actually hitting it.