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

Loop Once Over state.LatestAttestations in Epoch Processing #2342

Merged
merged 2 commits into from
Apr 22, 2019

Conversation

rauljordan
Copy link
Contributor

Part of #1586


Description

Write why you are making the changes in this pull request

Hi all, currently we have a lot of expensive operations that run a for loop over the state's latest attestations repeatedly, leading to some situations that often have quadratic or cubic time complexity. Many of the initial parts of epoch processing deal with sorting out current/prev epoch information from this list of state latest attestations, which could all be done in a single for loop.

Write a summary of the changes you are making

This PR combines all the functions that require extracting information from state.LatestAttestations to minimize the number of times epoch processing has to loop over that array, leading to performance gains.

@rauljordan rauljordan self-assigned this Apr 22, 2019
@rauljordan rauljordan added Enhancement New feature or request Priority: Critical Highest, immediate priority item Ready For Review labels Apr 22, 2019
@rauljordan rauljordan added this to the Sapphire milestone Apr 22, 2019
@codecov
Copy link

codecov bot commented Apr 22, 2019

Codecov Report

Merging #2342 into master will decrease coverage by 0.24%.
The diff coverage is 59.18%.

@@            Coverage Diff             @@
##           master    #2342      +/-   ##
==========================================
- Coverage   68.64%   68.39%   -0.25%     
==========================================
  Files         117      117              
  Lines        9224     9199      -25     
==========================================
- Hits         6332     6292      -40     
- Misses       2218     2234      +16     
+ Partials      674      673       -1

@rauljordan rauljordan merged commit 629626d into master Apr 22, 2019
@rauljordan rauljordan deleted the single-loop branch April 22, 2019 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Priority: Critical Highest, immediate priority item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants