go-twig/benchmark/MEMORY_RESULTS.md
semihalev 4d0e37e1a0 Implement Zero Allocation Plan Phase 1: Global String Cache Optimization
- Added global string cache for efficient string interning (5.2x faster)
- Implemented optimized tokenizer with object pooling
- Created comprehensive benchmarks and documentation
- Cleaned up old optimization files and experiments

Performance improvements:
- String interning: 5.2x faster (1,492 ns/op vs 7,746 ns/op)
- Zero allocations for common strings
- Same memory efficiency as original (36 B/op, 9 allocs/op)
2025-03-12 10:05:23 +03:00

15 lines
439 B
Markdown

## Memory Benchmark Results (as of 2025-03-12)
Environment:
- Go version: go1.24.1
- CPU: 8 cores
- GOMAXPROCS: 8
| Engine | Time (µs/op) | Memory Usage (KB/op) |
|-------------|--------------|----------------------|
| Twig | 0.40 | 0.12 |
| Go Template | 12.69 | 1.33 |
Twig is 0.03x faster than Go's template engine.
Twig uses 0.09x less memory than Go's template engine.