mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-28 05:24:22 +01:00
Before this update, the entire immutable record was **fully** deserialized **every** time it was compared in the sorter. This PR extends the sorter with incremental deserialization of record keys, only when needed and only if they weren’t already deserialized in a previous iteration. I hate that we panic on failed deserialization in `cmp`, but unfortunately, I can’t return `Result` as part of this interface. Looking for feedback around a better way to handle this. Alternatively, I could store the deserialization error as part of `SortableImmutableRecord` and check it before returning the record in `next`, thereby deferring the error handling. The downside of this approach is that it complicates debugging, since the error will be completely decoupled from the place where it occurs. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #2207