mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-12 09:46:14 -05:00
18 lines
304 B
Go
18 lines
304 B
Go
package hugolib
|
|
|
|
import (
|
|
"bytes"
|
|
"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++ {
|
|
page, _ := NewPage("bench")
|
|
page.ReadFrom(bytes.NewReader(sample.Bytes()))
|
|
}
|
|
}
|