Enable common extensions for benchmark Also, reset the timer after loading test data.
Vytautas Ĺ altenis vytas@rtfb.lt
Sat, 30 Jul 2016 21:40:13 +0300
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
ref_test.go
→
ref_test.go
@@ -80,7 +80,7 @@ // code so that compiler could never optimize away the call to runMarkdown()
var benchResultAnchor string func BenchmarkReference(b *testing.B) { - params := TestParams{Options: Options{Extensions: NoExtensions}} + params := TestParams{Options: Options{Extensions: CommonExtensions}} files := []string{ "Amps and angle encoding", "Auto links",@@ -115,6 +115,7 @@ continue
} tests = append(tests, string(inputBytes)) } + b.ResetTimer() for n := 0; n < b.N; n++ { for _, test := range tests { benchResultAnchor = runMarkdown(test, params)