Skip to content

Commit bb0b478

Browse files
authored
Merge pull request NebulousLabs#1694 from NebulousLabs/benches
add some persistence benchmarks to test various systems
2 parents 8369593 + 3ad08b8 commit bb0b478

File tree

6 files changed

+382
-8
lines changed

6 files changed

+382
-8
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ install:
1212
- glyphcheck ./...
1313
- make
1414

15-
script: make test && make test-long && make cover
15+
script: make test && make test-long && make cover && make bench
1616

1717
sudo: false
1818

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ install:
2222
build_script:
2323
- go test -tags="testing debug" -short ./...
2424
- go test -tags="testing debug" -v -race ./...
25+
- go test -tags="testing debug" -v -race ./...
26+
- go test -tags="testing debug" -v -timeout=500s -run=XXX -bench=. ./...

modules/consensus/accept_bench_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package consensus
22

33
import (
44
"path/filepath"
5+
"strconv"
56
"testing"
67

78
"github.com/NebulousLabs/Sia/build"
@@ -15,7 +16,7 @@ import (
1516
//
1617
// i7-4770, 1d60d69: 1.356 ms / op
1718
func BenchmarkAcceptEmptyBlocks(b *testing.B) {
18-
cst, err := createConsensusSetTester(b.Name())
19+
cst, err := createConsensusSetTester(b.Name() + strconv.Itoa(b.N))
1920
if err != nil {
2021
b.Fatal("Error creating tester: " + err.Error())
2122
}
@@ -77,7 +78,7 @@ func BenchmarkAcceptEmptyBlocks(b *testing.B) {
7778
//
7879
// i7-4770, 1d60d69: 3.579 ms / op
7980
func BenchmarkAcceptSmallBlocks(b *testing.B) {
80-
cst, err := createConsensusSetTester(b.Name())
81+
cst, err := createConsensusSetTester(b.Name() + strconv.Itoa(b.N))
8182
if err != nil {
8283
b.Fatal(err)
8384
}

modules/consensus/consensusset_bench_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// i7-4770, 1d60d69: 22.883 ms / op
1414
func BenchmarkCreateServerTester(b *testing.B) {
1515
for i := 0; i < b.N; i++ {
16-
cst, err := createConsensusSetTester(b.Name() + strconv.Itoa(i))
16+
cst, err := createConsensusSetTester(b.Name() + strconv.Itoa(b.N) + strconv.Itoa(i))
1717
if err != nil {
1818
b.Fatal(err)
1919
}

0 commit comments

Comments
 (0)