chore(ai): add comprehensive CLI configurations for all AI assistants

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
Krypto Kajun
2025-09-14 10:09:55 -05:00
parent 2c4f663728
commit a410f637cd
34 changed files with 2391 additions and 5 deletions

View File

@@ -0,0 +1,52 @@
# Reduce Memory Allocations
Reduce memory allocations in the following hot path: $ARGUMENTS
## Memory Optimization Strategy:
### 1. **Allocation Analysis**
- Identify high-frequency allocation points
- Measure current allocation rates and patterns
- Analyze garbage collection pressure
### 2. **Optimization Techniques**
#### **Object Pooling**
- Implement sync.Pool for frequently created objects
- Pool buffers, structs, and temporary objects
- Proper reset patterns for pooled objects
#### **Pre-allocation**
- Pre-allocate slices and maps when size is predictable
- Reuse existing data structures
- Avoid repeated allocations in loops
#### **Buffer Reuse**
- Reuse byte buffers and string builders
- Implement buffer pools for I/O operations
- Minimize string concatenation
### 3. **MEV Bot Specific Optimizations**
#### **Transaction Processing**
- Pool transaction objects and event structures
- Reuse parsing buffers
- Optimize log and metric object creation
#### **Mathematical Calculations**
- Pool uint256 and big.Int objects
- Reuse temporary calculation buffers
- Optimize precision object handling
## Implementation Guidelines:
- Measure allocation reduction with benchmarks
- Monitor garbage collection statistics
- Ensure thread safety in pooled objects
- Maintain code readability and maintainability
## Deliverables:
- Memory allocation reduction benchmarks
- Optimized code with pooling strategies
- GC pressure analysis before and after
- Memory usage monitoring enhancements
- Best practices documentation for team