Expand description
Smart pooling heuristics for automatic buffer pool management
This module provides intelligent heuristics for when and how to use memory pooling to maximize performance while minimizing memory overhead.
§Heuristics
- Size-based: Pool buffers above a minimum size threshold
- Frequency-based: Pool shapes accessed frequently
- Memory-aware: Adjust pooling based on available memory
- Operation-aware: Consider operation characteristics
§Example
use tenrso_exec::executor::pool_heuristics::PoolingPolicy;
let policy = PoolingPolicy::default();
// Should we pool a 1000-element f64 buffer?
if policy.should_pool(&[1000], std::mem::size_of::<f64>()) {
println!("Pooling recommended");
}Structs§
- Access
Pattern Tracker - Access pattern tracker for shape-based pooling decisions
- Pooling
Policy - Policy for determining when to use buffer pooling
- Pooling
Recommender - Automatic pooling recommendation engine
- Pooling
Report - Report with pooling recommendations
Constants§
- DEFAULT_
MAX_ POOL_ SIZE_ BYTES - Maximum buffer size (in bytes) to pool Very large buffers can cause memory pressure
- DEFAULT_
MIN_ ACCESS_ FREQUENCY - Minimum access frequency to warrant pooling Shape must be accessed at least this many times
- DEFAULT_
MIN_ POOL_ SIZE_ BYTES - Minimum buffer size (in bytes) to consider for pooling Buffers smaller than this are cheap to allocate/deallocate