index: don't log in benchmark, even to ioutil.Discard. just a CPU distraction.

Change-Id: Id4d8b761cd81a7c8abd7e21d139bffc818aff5e1
This commit is contained in:
Brad Fitzpatrick 2013-12-06 10:06:18 +04:00
parent 5709ab501f
commit 87a85c4543
2 changed files with 5 additions and 9 deletions

View File

@ -140,13 +140,13 @@ func (c *Corpus) scanFromStorage(s sorted.KeyValue) error {
var ms0 *runtime.MemStats
if logCorpusStats {
ms0 = memstats()
}
log.Printf("Slurping corpus to memory from index...")
log.Printf("Slurping corpus to memory from index... (1/6: meta rows)")
}
// We do the "meta" rows first, before the prefixes below, because it
// populates the blobs map (used for blobref interning) and the camBlobs
// map (used for hinting the size of other maps)
log.Printf("Slurping corpus to memory from index... (1/6: meta rows)")
if err := c.scanPrefix(s, "meta:"); err != nil {
return err
}
@ -162,7 +162,9 @@ func (c *Corpus) scanFromStorage(s sorted.KeyValue) error {
"imagesize|",
}
for i, prefix := range prefixes {
if logCorpusStats {
log.Printf("Slurping corpus to memory from index... (%d/%d: prefix %q)", i+2, len(prefixes)+1, prefix)
}
if err := c.scanPrefix(s, prefix); err != nil {
return err
}

View File

@ -18,8 +18,6 @@ package index_test
import (
"fmt"
"io/ioutil"
"log"
"sync"
"testing"
"time"
@ -58,9 +56,5 @@ func BenchmarkCorpusFromStorage(b *testing.B) {
if err != nil {
b.Fatal(err)
}
if i == 0 {
// Only worth logging any failures in the first round.
log.SetOutput(ioutil.Discard)
}
}
}