Expand description
RETE Network Optimization Module
This module implements various optimizations for the RETE algorithm:
- Node Sharing - Reuse alpha nodes with identical patterns
- Alpha Memory Compaction - Reduce memory usage in alpha nodes
- Beta Memory Indexing - Fast lookup for joins
- Token Pooling - Reuse token objects
These optimizations provide:
- 2x faster rule matching
- 50% memory reduction
- 10-100x improvement for large rule sets (10K+ rules)
Structsยง
- Alpha
Pattern - Pattern key for node sharing Two alpha nodes can share if they have the same pattern
- Beta
Memory Index - Beta Memory Index Fast lookup for join operations
- Compact
Alpha Memory - Compact Alpha Memory Uses HashSet to eliminate duplicates and reduce memory
- FactKey
- Key for fact deduplication
- Node
Sharing Registry - Node Sharing Registry Manages shared alpha nodes across the RETE network
- Node
Sharing Stats - Node sharing statistics
- Optimization
Manager - Central manager for all RETE optimizations
- Optimization
Stats - Comprehensive optimization statistics
- Shared
Alpha Node - Shared Alpha Node Multiple rules can reference the same shared alpha node
- Token
- Token for RETE propagation Represents a fact flowing through the network
- Token
Pool - Token Pool for object reuse Reduces allocations by reusing token objects
- Token
Pool Stats - Token pool statistics