Add benchmark for Node.fillExtra

This commit is contained in:
Alexander Neumann 2015-05-01 23:52:36 +02:00
parent d753a5ffa3
commit d8e1482abe
1 changed files with 27 additions and 0 deletions

27
node_test.go Normal file
View File

@ -0,0 +1,27 @@
package restic
import (
"io/ioutil"
"testing"
)
func BenchmarkNodeFillUser(t *testing.B) {
tempfile, err := ioutil.TempFile("", "restic-test-temp-")
if err != nil {
t.Fatal(err)
}
fi, err := tempfile.Stat()
if err != nil {
t.Fatal(err)
}
node := &Node{}
path := tempfile.Name()
t.ResetTimer()
for i := 0; i < t.N; i++ {
node.fillExtra(path, fi)
}
}