diff --git a/pkg/sum/labeler/labeler_test.go b/pkg/sum/labeler/labeler_test.go index 038be55..6670f31 100644 --- a/pkg/sum/labeler/labeler_test.go +++ b/pkg/sum/labeler/labeler_test.go @@ -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)) { @@ -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() diff --git a/pkg/sum/sum_test.go b/pkg/sum/sum_test.go index d248901..bb337f8 100644 --- a/pkg/sum/sum_test.go +++ b/pkg/sum/sum_test.go @@ -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 */ @@ -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")