-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Perf] Speed up the fetching of the latest block height #2515
Conversation
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
d1fa0c3
to
71c3806
Compare
Can you point readers to the logic/evidence that the change does not introduce an off-by-one error? |
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
@vicsn done; also, I noticed that originally there actually would have been an issue with a height equal to |
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
I just found 2 more instances of max block height lookup (without using One of them will further improve ledger loading time. |
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.
LGTM
Another heap-profiling find applicable to the loading of the ledger; by counting the number of heights instead of deserializing them, we can avoid a large number of allocations.
The results at height 330598 are as follows: