-
Notifications
You must be signed in to change notification settings - Fork 575
Conversation
✔️ Deploy Preview for stoic-ritchie-0f4a47 ready! 🔨 Explore the source changes: 2f5fbd0 🔍 Inspect the deploy log: https://app.netlify.com/sites/stoic-ritchie-0f4a47/deploys/6119db5c8e7ae10008fab37c 😎 Browse the preview: https://deploy-preview-436--stoic-ritchie-0f4a47.netlify.app |
how about the speed without logs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. I would add more comments to the code. Also, thoughts of using ReportAlloc()
?
x/evm/keeper/keeper_test.go
Outdated
@@ -50,20 +80,22 @@ type KeeperTestSuite struct { | |||
|
|||
appCodec codec.Codec | |||
signer keyring.Signer | |||
|
|||
EvmDenom string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can obtain this from the EVM module params
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed now, changed to a method.
@@ -146,6 +183,46 @@ func (suite *KeeperTestSuite) initKeepersWithmAccPerms() (authkeeper.AccountKeep | |||
return authKeeper, keeper | |||
} | |||
|
|||
// DeployTestContract deploy a test erc20 contract and returns the contract address | |||
func (suite *KeeperTestSuite) DeployTestContract(t require.TestingT, owner common.Address, supply *big.Int) common.Address { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious of why we are using require.TestingT
instead of testing.T
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it work on both testing.B
and testing.T
.
Added a line of comment to explain.
} | ||
|
||
func (suite *KeeperTestSuite) SetupTest() { | ||
func (suite *KeeperTestSuite) DoSetupTest(t require.TestingT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, can you add a comment on why you are using require.TestingT
instead of just making this the setup function as before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also on why you are using require.XXX(t, ...)
instead of suite.Require()
. Otherwise someone without the context could revert the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it work on both testing.B and testing.T.
Added a line of comment to explain.
b.ResetTimer() | ||
b.StartTimer() | ||
for i := 0; i < b.N; i++ { | ||
ctx, _ := suite.ctx.CacheContext() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why cache context here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make each run independent, we don't want to mutate the shared storage for each runs.
@yihuang I will merge this PR, but can you address the comments from the review in a follow-up PR? |
Visit https://dashboard.github.orijtech.com?back=0&pr=436&remote=true&repo=yihuang%2Fethermint to see benchmark details. |
Seems that some tests are failing |
Closes: #431
Description
it seems we do have some significant performance issue with log emit. takes a second to emit 1000 logs.
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)