Nu icon indicating copy to clipboard operation
Nu copied to clipboard

_ContentsOpt Fields Could Theoretically Thrash LOH

Open bryanedds opened this issue 2 years ago • 2 comments

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.

bryanedds avatar Jun 07 '23 17:06 bryanedds

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.

bryanedds avatar Jun 07 '23 17:06 bryanedds

Assert added as Log.warnOnce.

bryanedds avatar Apr 12 '24 14:04 bryanedds

I think an assert is good enough for now here. Potentially reopen if people start actually hitting it.

bryanedds avatar Aug 05 '24 12:08 bryanedds