mirror of
https://github.com/semihalev/twig.git
synced 2026-03-14 13:55:46 +01:00
- Added byteBufferPool to reuse buffers during rendering - Implemented WriteString utility function to eliminate allocations - Updated all node Render methods to use the optimized function - Reduced memory allocations during template rendering - Added benchmarks showing significant improvement with io.Writer 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
438 B
438 B
Memory Benchmark Results (as of 2025-03-11)
Environment:
- Go version: go1.24.1
- CPU: 8 cores
- GOMAXPROCS: 8
| Engine | Time (µs/op) | Memory Usage (KB/op) |
|---|---|---|
| Twig | 3.24 | 1.23 |
| Go Template | 8.71 | 1.26 |
Twig is 0.37x faster than Go's template engine. Twig uses 0.98x less memory than Go's template engine.