@@ -8,7 +8,7 @@ package codec
8
8
// see notes in z_all_test.go
9
9
10
10
import (
11
- "strconv "
11
+ "fmt "
12
12
"testing"
13
13
"time"
14
14
)
@@ -56,17 +56,20 @@ func benchmarkSuite(t *testing.B, fns ...func(t *testing.B)) {
56
56
tbvars .setBufsize (1024 )
57
57
testReinit ()
58
58
t .Run ("use-io-1024-...." , f )
59
+
60
+ tbvars .setBufsize (0 )
61
+ testReinit ()
62
+ t .Run ("use-io-0-......." , f )
59
63
}
60
64
61
65
func benchmarkVeryQuickSuite (t * testing.B , name string , fns ... func (t * testing.B )) {
62
66
defer tbvars .setBufsize ((int )(testv .bufsize ))
63
67
benchmarkDivider ()
64
68
65
69
tbvars .setBufsize (- 1 )
66
- // testv.Depth = depth
67
70
testReinit ()
68
71
69
- t .Run (name + " -bd" + strconv . Itoa ( testv . Depth ) + " ........" , benchmarkOneFn (fns ))
72
+ t .Run (fmt . Sprintf ( "%s -bd%d.. ......" , name , testv . Depth ) , benchmarkOneFn (fns ))
70
73
}
71
74
72
75
func benchmarkQuickSuite (t * testing.B , name string , fns ... func (t * testing.B )) {
@@ -75,14 +78,12 @@ func benchmarkQuickSuite(t *testing.B, name string, fns ...func(t *testing.B)) {
75
78
76
79
// encoded size of TestStruc is between 20K and 30K for bd=1 // consider buffer=1024 * 16 * testv.Depth
77
80
tbvars .setBufsize (1024 ) // (value of byteBufSize): use smaller buffer, and more flushes - it's ok.
78
- // testv.Depth = depth
79
81
testReinit ()
80
- t .Run (name + "-bd" + strconv . Itoa ( testv . Depth ) + "- buf" + strconv . Itoa (( int )( testv .bufsize ) ), benchmarkOneFn (fns ))
82
+ t .Run (fmt . Sprintf ( "%s-bd%d- buf%d" , name , testv .Depth , 1024 ), benchmarkOneFn (fns ))
81
83
82
84
tbvars .setBufsize (0 )
83
- // testv.Depth = depth
84
85
testReinit ()
85
- t .Run (name + "-bd" + strconv . Itoa ( testv . Depth ) + "- io....." , benchmarkOneFn (fns ))
86
+ t .Run (fmt . Sprintf ( "%s-bd%d- io.....", name , testv . Depth ) , benchmarkOneFn (fns ))
86
87
}
87
88
88
89
/*
0 commit comments