mirror of
https://github.com/semihalev/twig.git
synced 2026-03-14 13:55:46 +01:00
- 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)
439 B
439 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.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.