mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
23 lines
350 B
Go
23 lines
350 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++ {
|
|
ReadFrom(sample, "bench")
|
|
}
|
|
}
|
|
|
|
func BenchmarkNewPage(b *testing.B) {
|
|
for i := 0; i < b.N; i++ {
|
|
NewPage("redis.cn.md")
|
|
}
|
|
}
|