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

[Optimize] Cache the latest leader #3115

Merged
merged 3 commits into from Mar 9, 2024

Conversation

ljedrz
Copy link
Collaborator

@ljedrz ljedrz commented Feb 22, 2024

Leader computation is a relatively costly operation (it can take more than 1ms with a 4-member committee), and it is currently called several times for the same round. With a little bit of extra code and with negligible overhead we can cache the latest computed leader and in case of a hit, the leader can be procured 3 orders of magnitude (under 1 µs) faster.

note: this PR has a little bit of overlap (mostly related to dependencies) with #3106

@ljedrz ljedrz marked this pull request as draft February 22, 2024 16:44
@ljedrz
Copy link
Collaborator Author

ljedrz commented Feb 22, 2024

Ah, forgot about the mock ledger; will update shortly.

Ready for review.

@ljedrz ljedrz force-pushed the cache_latest_leader branch 3 times, most recently from a99afaa to f20ab4d Compare February 22, 2024 17:15
Signed-off-by: ljedrz <ljedrz@gmail.com>
@ljedrz ljedrz marked this pull request as ready for review February 22, 2024 17:46
@howardwu howardwu changed the title Cache the latest leader [Optimize] Cache the latest leader Mar 9, 2024
@howardwu howardwu merged commit 7f8ec95 into AleoNet:mainnet-staging Mar 9, 2024
5 of 24 checks passed
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.

None yet

4 participants