Squishing out more performance.
This commit is contained in:
parent
83be756015
commit
a9964163c1
|
@ -32,7 +32,7 @@ func main() {
|
||||||
flag.Usage()
|
flag.Usage()
|
||||||
}
|
}
|
||||||
|
|
||||||
toml, err := parse.Run(os.Stdin)
|
toml, err := parse.RunWithoutSanityChecks(os.Stdin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error decoding TOML: %s", err)
|
log.Fatalf("Error decoding TOML: %s", err)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -57,3 +57,11 @@ func Run(input interface{}) (ast.Table, error) {
|
||||||
err := parse.New(p.startDocument)(input)
|
err := parse.New(p.startDocument)(input)
|
||||||
return p.doc.Root, err
|
return p.doc.Root, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RunWithoutSanityChecks runs the TOML parser against the provided input data.
|
||||||
|
// The parsekit sanity checks are disabled during the parse run.
|
||||||
|
func RunWithoutSanityChecks(input interface{}) (ast.Table, error) {
|
||||||
|
p := newParser()
|
||||||
|
err := parse.New(p.startDocument)(input)
|
||||||
|
return p.doc.Root, err
|
||||||
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"github.com/pkg/profile"
|
"github.com/pkg/profile"
|
||||||
)
|
)
|
||||||
|
|
||||||
const runProfiler = false
|
const runProfiler = true
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
bytes, _ := ioutil.ReadAll(os.Stdin)
|
bytes, _ := ioutil.ReadAll(os.Stdin)
|
||||||
|
|
BIN
parse2/parse2
BIN
parse2/parse2
Binary file not shown.
Loading…
Reference in New Issue