File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,7 @@ func BenchmarkLegacyGetSigners(b *testing.B) {
3333 Amount : nil ,
3434 }}
3535
36- b .ResetTimer ()
37- for i := 0 ; i < b .N ; i ++ {
36+ for b .Loop () {
3837 _ = msg .GetSigners ()
3938 }
4039}
@@ -50,8 +49,7 @@ func BenchmarkProtoreflectGetSigners(b *testing.B) {
5049 Amount : nil ,
5150 }
5251
53- b .ResetTimer ()
54- for i := 0 ; i < b .N ; i ++ {
52+ for b .Loop () {
5553 _ , err := signingCtx .GetSigners (msg )
5654 if err != nil {
5755 panic (err )
@@ -72,8 +70,7 @@ func BenchmarkProtoreflectGetSignersWithUnmarshal(b *testing.B) {
7270 a , err := codectypes .NewAnyWithValue (msg )
7371 require .NoError (b , err )
7472
75- b .ResetTimer ()
76- for i := 0 ; i < b .N ; i ++ {
73+ for b .Loop () {
7774 _ , _ , err := cdc .GetMsgAnySigners (a )
7875 if err != nil {
7976 panic (err )
@@ -97,8 +94,7 @@ func BenchmarkProtoreflectGetSignersDynamicpb(b *testing.B) {
9794 err = protov2 .Unmarshal (bz , dynamicmsg )
9895 require .NoError (b , err )
9996
100- b .ResetTimer ()
101- for i := 0 ; i < b .N ; i ++ {
97+ for b .Loop () {
10298 _ , err := signingCtx .GetSigners (dynamicmsg )
10399 if err != nil {
104100 panic (err )
Original file line number Diff line number Diff line change @@ -165,10 +165,9 @@ func BenchmarkProtoCodecMarshalLengthPrefixed(b *testing.B) {
165165 }),
166166 }
167167
168- b .ResetTimer ()
169168 b .ReportAllocs ()
170169
171- for i := 0 ; i < b . N ; i ++ {
170+ for b . Loop () {
172171 blob , err := pCdc .MarshalLengthPrefixed (msg )
173172 if err != nil {
174173 b .Fatal (err )
You can’t perform that action at this time.
0 commit comments