Closed ascheglovclick closed 3 years ago
A set of optimisations related to allocations
Original BenchmarkParse BenchmarkParse-12 1446430 799.4 ns/op 288 B/op 14 allocs/op Remove redundant allocation BenchmarkParse BenchmarkParse-12 1482784 719.3 ns/op 256 B/op 12 allocs/op Use bytes.Buffer for matched BenchmarkParse BenchmarkParse-12 1745038 638.7 ns/op 184 B/op 5 allocs/op Preallocate required space BenchmarkParse/static BenchmarkParse/static-12 2146411 536.6 ns/op 144 B/op 2 allocs/op Reusable parser BenchmarkParse/reusable BenchmarkParse/reusable-12 2438487 494.8 ns/op 80 B/op 1 allocs/op
A set of optimisations related to allocations