shithub: hugo

ref: 6c25cd529f9d65db4a0b70b8c1518bb7eeec19a6
dir: /hugolib/benchmark_test.go/

View raw version
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()))
	}
}