Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hclsyntax: Copy only tok.Range instead of whole object
Doing this reduces the memory used in ~11%, as the following benchstat comparison shows: name old time/op new time/op delta LexConfig-12 9.27µs ± 0% 9.03µs ± 1% -2.55% (p=0.000 n=9+10) name old alloc/op new alloc/op delta LexConfig-12 8.94kB ± 0% 7.98kB ± 0% -10.74% (p=0.000 n=10+10) name old allocs/op new allocs/op delta LexConfig-12 37.0 ± 0% 37.0 ± 0% ~ (all equal) Benchmarks were created using: go test -benchmem -benchtime=200000x -count=10 -bench=.
- Loading branch information