File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1658,6 +1658,14 @@ mod bucketed_history {
1658
1658
#[ derive( Clone , Copy ) ]
1659
1659
#[ repr( C ) ] // Force the fields in memory to be in the order we specify.
1660
1660
pub ( super ) struct HistoricalLiquidityTracker {
1661
+ // This struct sites inside a `(u64, ChannelLiquidity)` in memory, and we first read the
1662
+ // liquidity offsets in `ChannelLiquidity` when calculating the non-historical score. This
1663
+ // means that the first handful of bytes of this struct will already be sitting in cache by
1664
+ // the time we go to look at them.
1665
+ //
1666
+ // Because the first thing we do is check if `total_valid_points` is sufficient to consider
1667
+ // the data here at all, and can return early if it is not, we want this to go first to
1668
+ // avoid hitting a second cache line load entirely in that case.
1661
1669
total_valid_points_tracked : u64 ,
1662
1670
min_liquidity_offset_history : HistoricalBucketRangeTracker ,
1663
1671
max_liquidity_offset_history : HistoricalBucketRangeTracker ,
You can’t perform that action at this time.
0 commit comments