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

more profile speed improvments #4762

Merged
merged 1 commit into from
Jul 11, 2019
Merged

more profile speed improvments #4762

merged 1 commit into from
Jul 11, 2019

Conversation

owocki
Copy link
Contributor

@owocki owocki commented Jul 9, 2019

Description

more profile speed improvments (see comments inline for desc)

Refers/Fixes

#4620

Testing

tested locally

@@ -2641,8 +2641,7 @@ def get_eth_sum(self, sum_type='collected', network='mainnet', bounties=None):

"""
eth_sum = 0

if not bounties:
if bounties is None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if bounties.exists() was 0, then this condition was hit and we'd lookup the get_funded_bounties() again.. thus hurting performance

eth_sum = bounties.aggregate(
Sum('value_in_eth')
)['value_in_eth__sum'] / 10**18
eth_sum = sum([amount for amount in bounty.values_list("value_in_eth", flat=True)])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is much faster.. 0.45 vs 0.02s

@owocki owocki merged commit 6f38d50 into master Jul 11, 2019
@thelostone-mc thelostone-mc deleted the kevin/profile_speed_4 branch June 27, 2020 00:48
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.

2 participants