Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed -count #5

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading