8000 perf: enhance performance in state by faddat · Pull Request #1977 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

perf: enhance performance in state #1977

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

Closed
wants to merge 20 commits into from

Conversation

faddat
Copy link
Contributor
@faddat faddat commented Jan 6, 2024

Working on #1976 and also examining other ways to improve performance.

closes: #1976


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@faddat faddat requested review from a team as code owners January 6, 2024 12:42
@faddat
Copy link
Contributor Author
faddat commented Jan 6, 2024

Needs #1954

@faddat
Copy link
Contributor Author
faddat commented Jan 6, 2024

@ValarDragon - I don't think that this is quite done correctly yet, but could you take a peek?

@faddat
Copy link
Contributor Author
faddat commented Jan 6, 2024

oh I def found a bug.... it is strange that tests pass

@faddat faddat changed the title enhance performance in state perf: enhance performance in state Jan 7, 2024
@faddat
Copy link
Contributor Author
faddat commented Jan 7, 2024

I was afraid of that...

Note: need to undo some doings and redo some others.

@faddat faddat marked this pull request as draft January 7, 2024 06:35
@faddat
Copy link
Contributor Author
faddat commented Jan 7, 2024

@ValarDragon @melekes - what would be a good way to benchmark here?

And what should be "the standard"?

@faddat faddat marked this pull request as ready for review January 9, 2024 19:47
@faddat
Copy link
Contributor Author
faddat commented Jan 9, 2024

This isn't the same thing reported by @ValarDragon but I think it's related:

cometbft/cometbft-db#112 (comment)

Copy link
Contributor
@melekes melekes left a comment

Choose a reason for hiding this comment

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

While there are some nice improvements here, this PR fails to address the main issue described in #1976

return dbStore{db, options}
return &dbStore{
db: db,
valInfoCache: make(map[int64]*cmtstate.ValidatorsInfo),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need these? I don't see them used anywhere in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe that I made a branch management mistake here. Thanks for review.

Copy link
Contributor Author
@faddat faddat Jan 21, 2024

Choose a reason for hiding this comment

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

Hey, I'm wrong. Basically one finding was that it was faster to use pointers and lay things out first. That's why that's there.

Could you let me know if that is a decent direction?

I prefer the original form of the code, and the current performance. It was hard to determine exactly where perf improvements came from though.

@faddat faddat mentioned this pull request Jan 11, 2024
3 tasks
@faddat faddat force-pushed the faddat/fix-dedupe branch from 57aca9b to 9260202 Compare January 11, 2024 23:35
@faddat
Copy link
Contributor Author
faddat commented Jan 11, 2024

@melekes I will do more here, once

has been merged.

@faddat faddat marked this pull request as draft January 11, 2024 23:45
@faddat
Copy link
Contributor Author
faddat commented Jan 23, 2024

I'm opening this for review again -- close if anyone thinks is not needed, it seems like I went outside of the original intended scope.

@faddat faddat marked this pull request as ready for review January 23, 2024 17:31
@faddat
Copy link
Contributor Author
faddat commented Jan 31, 2024

Hey I'm going to close this with the note to self that we should have more benchmarks across the code base

@faddat faddat closed this Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

perf: De-duplicate writes in SaveABCIResponses / SaveFinalizeBlockResponse
2 participants
0