go-twig/benchmark/MEMORY_RESULTS.md
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

438 B

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.20 0.12
Go Template 9.31 1.34

Twig is 0.02x faster than Go's template engine. Twig uses 0.09x less memory than Go's template engine.