I like the current text formatter. It is very fast compared to what I have seen before and requires minimal allocations. It is especially that last part I care about most, since less allocations means less GC pressure.
The benchmarks in text_test.go show that we still require 5 allocations for small entries and 28 for large entries. We should invest time to bring this number down even further.
$ go test -bench 'BenchmarkSmallTextColoredTextFormatter' -test.benchmem -run '$^'
PASS
BenchmarkSmallTextColoredTextFormatter-6 1000000 1735 ns/op 71.45 MB/s 15 B/op 5 allocs/op
ok github.com/pjvds/tidy 1.762s
I like the current text formatter. It is very fast compared to what I have seen before and requires minimal allocations. It is especially that last part I care about most, since less allocations means less GC pressure.
The benchmarks in
text_test.go
show that we still require5
allocations for small entries and28
for large entries. We should invest time to bring this number down even further.