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

caches activity view props to save about 0.5s per HTTPRequest to /activity on townsquare #6079

Merged
merged 6 commits into from
Feb 26, 2020

Conversation

owocki
Copy link
Contributor

@owocki owocki commented Feb 26, 2020

Description

caches activity view props to save about 0.5s per HTTPRequest to /activity on townsquare

Refers/Fixes

personal gripes with townsquare speed

Testing

tested locally, works fine.

@owocki owocki changed the title caches activity view props to save about 0.5s per HTTPRequest on townsquare caches activity view props to save about 0.5s per HTTPRequest to /activity on townsquare Feb 26, 2020

def generate_view_props_cache(self):
self.cached_view_props = self.view_props
self.cached_view_props = json.loads(json.dumps(self.cached_view_props, cls=EncodeAnything))
Copy link
Contributor

Choose a reason for hiding this comment

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

So sketchy... I should have never put this in the codebase in the first place LOL 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it seems entirely ridiculous to make that the default json encoder doesnt encode datetimes..

@codecov
Copy link

codecov bot commented Feb 26, 2020

Codecov Report

Merging #6079 into stable will increase coverage by 0.26%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           stable    #6079      +/-   ##
==========================================
+ Coverage   28.65%   28.91%   +0.26%     
==========================================
  Files         272      272              
  Lines       24174    24213      +39     
  Branches     3537     3541       +4     
==========================================
+ Hits         6927     7002      +75     
+ Misses      16967    16905      -62     
- Partials      280      306      +26
Impacted Files Coverage Δ
app/kudos/views.py 14.83% <ø> (ø) ⬆️
app/townsquare/views.py 9.5% <ø> (ø) ⬆️
app/dashboard/views.py 11.84% <0%> (ø) ⬆️
app/retail/views.py 23.47% <0%> (+1.12%) ⬆️
app/townsquare/tasks.py 33.33% <20%> (-3.26%) ⬇️
app/townsquare/models.py 57.51% <33.33%> (-0.96%) ⬇️
app/dashboard/models.py 53.93% <43.47%> (+1.35%) ⬆️
...eting/management/commands/expiration_start_work.py 68.29% <0%> (-2.44%) ⬇️
app/dashboard/notifications.py 16.13% <0%> (-0.34%) ⬇️
...eting/management/commands/assemble_leaderboards.py 42.2% <0%> (ø) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9bad3a...ee604af. Read the comment docs.

@owocki
Copy link
Contributor Author

owocki commented Feb 26, 2020

tests passing ... merging now

@owocki owocki merged commit bab91b1 into stable Feb 26, 2020
@thelostone-mc thelostone-mc deleted the kevin/cache_activity_feed_viewprops branch June 27, 2020 00:49
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