parser: Improve TOML frontmatter parser performance
authorAlbert Nigmatzianov <albertnigma@gmail.com>
Mon, 20 Mar 2017 05:47:46 +0000 (10:47 +0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 20 Mar 2017 08:02:35 +0000 (09:02 +0100)
commitd3cd68e65646c77da94a9322758519e2ef821ec6
tree37b177cea59f338348c771a62d7d3d9c94eb959c
parent68f4cd829ee32a2449c4fbea392ace9f7f8022cf
parser: Improve TOML frontmatter parser performance

Difference between toml.Load(string(datum)) and
toml.LoadReader(bytes.NewReader(datum)):
benchmark           old ns/op     new ns/op     delta
BenchmarkLoad-4     82068         78489         -4.36%

benchmark           old allocs     new allocs     delta
BenchmarkLoad-4     494            493            -0.20%

benchmark           old bytes     new bytes     delta
BenchmarkLoad-4     17009         16913         -0.56%
parser/frontmatter.go