Open minicheddar opened 1 year ago
Rust does not allow ordering of f32/f64s as part of std. This prevents using f64 as a key in BTreeMap<f64, OrderbookLevel>.
f32
f64
BTreeMap<f64, OrderbookLevel>
For now, we should just use this (https://crates.io/crates/ordered-float), but I'm curious on the performance difference between.
PartialOrd
Decimal
MarketDataKind:L2Update/Snapshot
u64
This is definitely a low-priority premature micro-optimisation!
Rust does not allow ordering of
f32
/f64
s as part of std. This prevents usingf64
as a key inBTreeMap<f64, OrderbookLevel>
.For now, we should just use this (https://crates.io/crates/ordered-float), but I'm curious on the performance difference between.
PartialOrd
for floats as aboveDecimal
f64
, but converting toDecimal
when returningMarketDataKind:L2Update/Snapshot
u64
with a mantissa on the number of floating points as a separate piece of metadata (like smart contracts)This is definitely a low-priority premature micro-optimisation!