Module trading_pools

Source
Expand description

Trading-specific memory pools for zero-allocation hot paths

This module provides specialized memory pool integrations designed for high-frequency trading operations, eliminating allocations in critical paths such as order processing, WebSocket message handling, and market data processing.

Re-exports§

pub use OrderProcessingPool8 as DefaultOrderProcessingPool;
pub use TradingPoolManager4096 as DefaultTradingPoolManager;
pub use WebSocketMessagePool4096 as DefaultWebSocketMessagePool;

Structs§

DefaultOrderProcessing
Default implementation for buffer allocation
JsonProcessingPool
JSON processing pool for zero-allocation JSON operations
MarketDataPool
Market data pool for zero-allocation market data processing
OrderProcessingPool
Order processing pool for zero-allocation order operations with const generic SmallVec capacity
TradingPoolManager
Trading-specific memory pool manager for zero-allocation operations with const generic buffer sizing
WebSocketMessagePool
WebSocket message pool for zero-allocation message processing with const generic threshold

Enums§

OrderBufferType
Types of order processing buffers
WebSocketMessageType
WebSocket message types for pool optimization

Traits§

PooledOrderProcessing
Helper trait for zero-allocation order processing Note: Concrete implementations should be done in crates that have access to order types
PooledWebSocketMessage
Helper trait for zero-allocation WebSocket message processing

Functions§

get_global_trading_pools
Get global trading pools (use for initialization and statistics)
get_thread_local_poolsDeprecated
Get thread-local trading pools (legacy API for compatibility)
initialize_trading_pools
Initialize trading pools with custom configuration
with_thread_local_pools
Get thread-local trading pools for maximum performance

Type Aliases§

OrderProcessingPool4
Order processing pool with SmallVec capacity of 4 elements
OrderProcessingPool8
Order processing pool with SmallVec capacity of 8 elements
OrderProcessingPool16
Order processing pool with SmallVec capacity of 16 elements
TradingPoolManager2048
Trading pool manager with 2KB WebSocket threshold and 16-element SmallVec capacity
TradingPoolManager4096
Trading pool manager with 4KB WebSocket threshold and 8-element SmallVec capacity
TradingPoolManager8192
Trading pool manager with 8KB WebSocket threshold and 4-element SmallVec capacity
WebSocketMessagePool2048
WebSocket message pool with 2KB threshold for small messages
WebSocketMessagePool4096
WebSocket message pool with 4KB threshold for small messages
WebSocketMessagePool8192
WebSocket message pool with 8KB threshold for small messages