hugo/hugolib/benchmark_test.go

24 lines
350 B
Go
Raw Normal View History

package hugolib
import (
"bytes"
2013-08-07 06:04:49 +00:00
"os"
"testing"
)
func BenchmarkParsePage(b *testing.B) {
f, _ := os.Open("redis.cn.md")
sample := new(bytes.Buffer)
sample.ReadFrom(f)
b.ResetTimer()
for i := 0; i < b.N; i++ {
2013-08-07 06:04:49 +00:00
ReadFrom(sample, "bench")
}
}
func BenchmarkNewPage(b *testing.B) {
for i := 0; i < b.N; i++ {
NewPage("redis.cn.md")
}
}