-
Notifications
You must be signed in to change notification settings - Fork 719
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
[DMNs] Implement lru cache #2883
Conversation
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.
tACK d0e449e
Looks good in comparison to upstream, we can potentially update this a bit more later in seeing how the vector handles the sorting by access time if it becomes an area for some perf improvements, we can look at adjusting it later after seeing how it does
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 e3a9721
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.
tACK e3a9721
A LRU cache is an (unordered) map where, once it is full, the least recently used element is removed.
This PR adds a LRU cache that maps
quorumHash
->bool
wherebool
istrue
iff the quorum has been mined on chain.It is a big optimization compared to checking the database each time