mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-29 07:00:31 +03:00
hugolib: Clean up a benchmark
This commit is contained in:
parent
c344b1901f
commit
cb63e87f8d
3 changed files with 13 additions and 31 deletions
|
@ -14,8 +14,10 @@
|
|||
package hugolib
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"sort"
|
||||
|
@ -1396,3 +1398,14 @@ func TestShouldBuild(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkParsePage(b *testing.B) {
|
||||
f, _ := os.Open("testdata/redis.cn.md")
|
||||
var buf bytes.Buffer
|
||||
buf.ReadFrom(f)
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
page, _ := NewPage("bench")
|
||||
page.ReadFrom(bytes.NewReader(buf.Bytes()))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue