File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1658,6 +1658,14 @@ mod bucketed_history {
16581658 #[ derive( Clone , Copy ) ]
16591659 #[ repr( C ) ] // Force the fields in memory to be in the order we specify.
16601660 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.
16611669 total_valid_points_tracked : u64 ,
16621670 min_liquidity_offset_history : HistoricalBucketRangeTracker ,
16631671 max_liquidity_offset_history : HistoricalBucketRangeTracker ,
You can’t perform that action at this time.
0 commit comments