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

drand: fix beacon cache #6164

Merged
merged 1 commit into from
May 1, 2021
Merged

drand: fix beacon cache #6164

merged 1 commit into from
May 1, 2021

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Apr 30, 2021

No description provided.

@magik6k magik6k requested a review from arajasek as a code owner April 30, 2021 18:58
@@ -168,8 +168,8 @@ func (db *DrandBeacon) getCachedValue(round uint64) *types.BeaconEntry {
if !ok {
return nil
}
e, _ := v.(*types.BeaconEntry)
return e
e, _ := v.(types.BeaconEntry)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe switch to storying pointers in the cache. Now we are pulling out a pointer (interface{}) out of the cache, dereferencing it to struct, and then we take a pointer of that struct which escapes causing allocation.

@arajasek arajasek merged commit 2a90de3 into master May 1, 2021
@arajasek arajasek deleted the fix/drand-cache branch May 1, 2021 16:21
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.

3 participants