This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* tests: add benchmark tests setup * fix: localized benchmark tests to keeper * update benchmark Co-authored-by: Federico Kunze Küllmer <[email protected]> (cherry picked from commit 9305788) Co-authored-by: Vladislav Varadinov <[email protected]>
- Loading branch information
1 parent
64e80be
commit 00b0d44
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package keeper_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/evmos/ethermint/x/evm/types" | ||
) | ||
|
||
func BenchmarkSetParams(b *testing.B) { | ||
suite := KeeperTestSuite{} | ||
suite.SetupTestWithT(b) | ||
params := types.DefaultParams() | ||
|
||
b.ReportAllocs() | ||
b.ResetTimer() | ||
for i := 0; i < b.N; i++ { | ||
_ = suite.app.EvmKeeper.SetParams(suite.ctx, params) | ||
} | ||
} | ||
|
||
func BenchmarkGetParams(b *testing.B) { | ||
suite := KeeperTestSuite{} | ||
suite.SetupTestWithT(b) | ||
|
||
b.ReportAllocs() | ||
b.ResetTimer() | ||
for i := 0; i < b.N; i++ { | ||
_ = suite.app.EvmKeeper.GetParams(suite.ctx) | ||
} | ||
} |