You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, we used `u64`, which is unlikely to ever overflow.
Even at 60 Hz, it would take ~9.7 billion years.
But the code used checked operations, even though they would not help.
I was going to switch to regular operations, but realized that if we
handle overflows properly, we could save some traffic.
By default, integers in postcard are serialized with varint encoding.
> 128 takes 2 bytes, > 16384 takes 3 bytes, and so on. But we can switch
to `u16` with overflow handling and fixint encoding, which always
takes 2
bytes.
This also simplifies the logic inside `batches_after`.
I also had to replace `BTreeMap` with `HashMap`, but we don't need to
preserve the ordering since we iterate over indices, so it's fine.
0 commit comments