Module collections

Source
Expand description

Common collection type aliases for consistent usage across the codebase

This module provides re-exports of performance-optimized collection types that should be used throughout the rusty trading system.

§Performance Benefits

§FxHashMap/FxHashSet

  • Uses FxHash (Firefox’s fast hash) instead of SipHash
  • 2-4x faster for small keys (integers, short strings)
  • No cryptographic security (not needed for HFT)
  • Better cache locality

§SmallVec

  • Stack-allocated for small collections
  • Zero heap allocations for typical sizes
  • Seamless fallback to heap when needed
  • 8-51% performance improvement in benchmarks

Structs§

SmallVec
A Vec-like container that can store a small number of elements inline.

Constants§

EXECUTION_CAPACITY
Default capacity for execution-related SmallVecs
MATCH_CAPACITY
Default capacity for match-related SmallVecs
STRATEGY_CAPACITY
Default capacity for strategy-related SmallVecs

Type Aliases§

FxHashMap
Type alias for a hash map that uses the Fx hashing algorithm.
FxHashSet
Type alias for a hash set that uses the Fx hashing algorithm.
SmallExecutionVec
Small vector for executions (typically < 4 executions per order)
SmallFeatureVec
Small vector for features/signals (typically < 32 features)
SmallMatchVec
Small vector for match info results (typically < 4 matches per operation)
SmallOrderVec
Small vector for order collections (typically < 16 orders)
SmallPriceLevelVec
Small vector for price levels (typically < 20 levels)
SmallRiskRuleVec
Small vector for risk rules (typically < 8 rules in HFT systems)
SmallSignalVec
Small vector for signals (typically < 8 signals per update)
SmallStrategyVec
Small vector for strategies (typically < 4 strategies per instrument)
SmallSymbolVec
Small vector for symbol lists (typically < 10 symbols)
SmallTradeVec
Small vector for trade updates (typically < 8 trades)