SquireCore icon indicating copy to clipboard operation
SquireCore copied to clipboard

[Feat]: Cows in Operations

Open TylerBloom opened this issue 2 years ago • 0 comments

Unmet Need:

Currently, the types used in tournament sync, namely OpSlice, hold vectors of operations. This makes sense since they could, at any point, run into a sync issue and need to return themselves and be (de)serialized. However, we can do slightly better. There is no need for this extra allocation if everything stays local.

To solve this, OpSlices should hold a Cow<'a, [FullOp]> and deserialize into the owned variant. Things that hold an OpSlice, such as a Blockage, are free to restring their slices to be 'static to avoid messy lifetime annotations when they are not needed. Of course, this could be added later if additional performance is needed.

TylerBloom avatar Feb 11 '23 20:02 TylerBloom