Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear time improvements to epoch time #517

Merged
merged 1 commit into from
Oct 13, 2021
Merged

Conversation

ValarDragon
Copy link
Member

These simple improvements speedup epoch time by 10% after #510

@codecov-commenter
Copy link

Codecov Report

Merging #517 (516492d) into main (17eda92) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #517      +/-   ##
==========================================
- Coverage   20.41%   20.40%   -0.01%     
==========================================
  Files         163      163              
  Lines       23206    23210       +4     
==========================================
- Hits         4738     4737       -1     
- Misses      17694    17698       +4     
- Partials      774      775       +1     
Impacted Files Coverage Δ
x/incentives/keeper/gauge.go 61.45% <100.00%> (+0.13%) ⬆️
x/claim/genesis.go 60.00% <0.00%> (-9.24%) ⬇️
x/pool-incentives/types/genesis.go 32.00% <0.00%> (-2.79%) ⬇️
x/pool-incentives/keeper/distr.go 82.82% <0.00%> (-1.14%) ⬇️
x/claim/keeper/claim.go 64.16% <0.00%> (-1.09%) ⬇️
x/incentives/keeper/store.go 76.74% <0.00%> (-0.53%) ⬇️
app/app.go 85.47% <0.00%> (ø)
x/mint/keeper/keeper.go 63.63% <0.00%> (ø)
x/incentives/types/keys.go 0.00% <0.00%> (ø)
x/pool-incentives/keeper/genesis.go
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17eda92...516492d. Read the comment docs.

Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the main change in this commit is that we are removing unnecessary coin validations for linear time improvements. My question is: were the validations actually unnecessary?(e.g validation happening twice somewhere else) Or are we simply trying to prioritize improvements on epoch time?

@ValarDragon
Copy link
Member Author

sdk.NewCoin checks that every amount is non-zero. But we should be guaranteed that by construction. (Also a zero amount is fine for use with Add, it won't cause an error)

The denom validation was moved so that it validates the denom only once, not in the hot loop.

@mattverse
Copy link
Member

Gotcha! Looks LGTM!!

@ValarDragon
Copy link
Member Author

Sweet! In the future, can you hit approve via github review API =)

@ValarDragon ValarDragon merged commit dd1e4ee into main Oct 13, 2021
@ValarDragon ValarDragon deleted the dev/epoch_improvements branch October 13, 2021 15:36
@github-actions github-actions bot mentioned this pull request Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants