projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
599e667
)
Fix benchmark so the buffer is read each time.
author
Noah Campbell
<noahcampbell@gmail.com>
Tue, 20 Aug 2013 23:56:18 +0000
(16:56 -0700)
committer
Noah Campbell
<noahcampbell@gmail.com>
Fri, 23 Aug 2013 21:16:37 +0000
(14:16 -0700)
The bytes.Buffer was exhausted after the first read. Creating a new
reader each invocation catpures the correctly timing.
hugolib/benchmark_test.go
patch
|
blob
|
history
diff --git
a/hugolib/benchmark_test.go
b/hugolib/benchmark_test.go
index 31e58a14aa68a72f36765a90d0167f76971934eb..a3408896d6c9d14e24c62aa07830ab5c4878fb43 100644
(file)
--- a/
hugolib/benchmark_test.go
+++ b/
hugolib/benchmark_test.go
@@
-12,7
+12,8
@@
func BenchmarkParsePage(b *testing.B) {
sample.ReadFrom(f)
b.ResetTimer()
for i := 0; i < b.N; i++ {
- ReadFrom(sample, "bench")
+ p, _ := ReadFrom(bytes.NewReader(sample.Bytes()), "bench")
+ p = p
}
}