Skip to content

Commit

Permalink
Fixed -count (#5)
Browse files Browse the repository at this point in the history
Signed-off-by: bwplotka <[email protected]>
  • Loading branch information
bwplotka authored Jan 2, 2024
1 parent 1904530 commit abebdec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pkg/sum/labeler/labeler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"sync"
"testing"

"github.com/efficientgo/core/testutil"
"github.com/efficientgo/examples/pkg/sum/sumtestutil"
"github.com/efficientgo/core/testutil"
"github.com/gobwas/pool/pbytes"
"github.com/thanos-io/objstore"
"github.com/gobwas/pool/pbytes"
"github.com/thanos-io/objstore"
)

func bench1(b *testing.B, labelFn func(ctx context.Context, objID string) (label, error)) {
Expand Down Expand Up @@ -62,7 +62,7 @@ func bench2(b *testing.B, labelFn func(ctx context.Context, objID string) (label
}

// BenchmarkLabeler recommended run options:
// $ export ver=v1 && go test -run '^$' -bench '^BenchmarkLabeler' -benchtime 100x -count 5 -cpu 1 -benchmem -memprofile=${ver}.mem.pprof -cpuprofile=${ver}.cpu.pprof | tee ${ver}.txt
// $ export ver=v1 && go test -run '^$' -bench '^BenchmarkLabeler' -benchtime 100x -count 6 -cpu 1 -benchmem -memprofile=${ver}.mem.pprof -cpuprofile=${ver}.cpu.pprof | tee ${ver}.txt
func BenchmarkLabeler(b *testing.B) {
ctx := context.Background()
bkt := objstore.NewInMemBucket()
Expand Down
5 changes: 3 additions & 2 deletions pkg/sum/sum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func lazyCreateTestInput(tb testing.TB, numLines int) string {
/*
export ver=v1 && go test \
-run '^$' -bench '^BenchmarkSum$' \
-benchtime 10s -count 5 -cpu 4 -benchmem \
-benchtime 10s -count 6 -cpu 4 -benchmem \
-memprofile=${ver}.mem.pprof -cpuprofile=${ver}.cpu.pprof \
| tee ${ver}.txt
*/
Expand Down Expand Up @@ -140,7 +140,8 @@ func benchmarkSum(tb testutil.TB) {
}

// BenchmarkSum_fgprof recommended run options:
// $ export ver=v1fg && go test -run '^$' -bench '^BenchmarkSum_fgprof' -benchtime 60s -count 1 -cpu 1 | tee ${ver}.txt
// $ export ver=v1fg && go test -run '^$' -bench '^BenchmarkSum_fgprof' \
// -benchtime 60s -cpu 1 | tee ${ver}.txt
// Read more in "Efficient Go"; Example 10-2.
func BenchmarkSum_fgprof(b *testing.B) {
f, err := os.Create("fgprof.pprof")
Expand Down

0 comments on commit abebdec

Please sign in to comment.