Commit graph

4 commits

Author SHA1 Message Date
semihalev
0548a9d547 Indent format fixes 2025-03-12 20:49:11 +03:00
semihalev
b081db6b80 Consolidate optimizations and cleanup codebase
- Merged buffer pooling optimizations into buffer_pool.go
- Integrated string interning and tag detection into zero_alloc_tokenizer.go
- Removed duplicate and superseded optimization implementations
- Added optimized expression parsing to expr.go
- Ensured all tests pass with consolidated implementation
- Maintained zero allocation implementation for tokenization

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-12 11:30:44 +03:00
semihalev
28c18edb38 Implement Zero Allocation Plan Phase 2: Optimized String Lookup During Tokenization
- Added specialized tag detection with direct byte operations
- Implemented hybrid tokenizer approach for template size optimization
- Created comprehensive benchmarks for tag detection and tokenization
- Documented results in TOKENIZER_V2_BENCHMARK_RESULTS.md

Performance improvements:
- Large template tokenization: 154× faster (306,697 ns/op vs 47,226,410 ns/op)
- Zero allocations for all template sizes
- Memory usage for large templates: 0 B/op vs 37,477 B/op
- Small templates: Similar performance to original implementation
2025-03-12 10:16:33 +03:00
semihalev
435bb12ac3 Optimize expression evaluation to reduce allocations
- Implemented pooled slices for function arguments
- Added specialized pooling for variable node and literal node objects
- Modified array and hash node evaluation to reduce allocations
- Optimized test and filter evaluation with pooled resources
- Added comprehensive benchmarks to validate improvements
- Updated node pool implementation to remove duplicate declarations
- Fixed memory allocations in merge filter to correctly handle array manipulations

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-12 03:04:36 +03:00