Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

fixes bug 1165411 - Optimize modelfilter choices #96

Merged
merged 1 commit into from May 22, 2015
Merged

fixes bug 1165411 - Optimize modelfilter choices #96

merged 1 commit into from May 22, 2015

Conversation

peterbe
Copy link
Contributor

@peterbe peterbe commented May 15, 2015

@camd r?

This is going to make a HUGE difference.
Actually, when I tested the pjax URLs with curl, it only became about a second faster. From hovering around 2.5seconds each request to about 1.7seconds.

But that's (less than) 1 seconds LESS of MySQL CPU burden to worry itself with. Instead of doing 8 big fat select statements on each list, it's now 0. (except every 1 hour is flushes the cache).

@peterbe peterbe changed the title fixes Optimize modelfilter choices @peterbe fixes bug 1165411 - Optimize modelfilter choices May 15, 2015
@peterbe peterbe changed the title @peterbe fixes bug 1165411 - Optimize modelfilter choices fixes bug 1165411 - Optimize modelfilter choices May 15, 2015
@classmethod
def delete_modelfilter_choices_cache(cls, model):
cache_key = 'modelfilter-choices-%s' % (model._meta,)
# print cache_key
Copy link
Contributor

Choose a reason for hiding this comment

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

remove comment

@camd
Copy link
Contributor

camd commented May 22, 2015

r+
This is awesome! just a couple comments to remove. But please go ahead and merge it. :)
I'm happy to push to stage as soon as you do.

@peterbe
Copy link
Contributor Author

peterbe commented May 22, 2015

Comments removed and rebased into 1 commit. Your move mister :)

camd pushed a commit that referenced this pull request May 22, 2015
…h_user-mysql-queries

fixes bug 1165411 - Optimize modelfilter choices
@camd camd merged commit 0469661 into mozilla:master May 22, 2015
@camd
Copy link
Contributor

camd commented May 22, 2015

Merged and Pushed to stage! :)

On May 22, 2015, at 4:24 PM, Peter Bengtsson notifications@github.com wrote:

Comments removed and rebased into 1 commit. Your move mister :)


Reply to this email directly or view it on GitHub #96 (comment).

@peterbe peterbe deleted the bug-1165411-optimize-repeated-auth_user-mysql-queries branch May 27, 2015 15:05
@peterbe
Copy link
Contributor Author

peterbe commented May 27, 2015

When this gets pushed to prod, let's all stick our heads into newrelic and see what difference it makes. If any :)

@@ -559,6 +561,11 @@ def test_choices(self):

class ModelFilterTest(FiltersTestCase):
"""Tests for ModelFilter."""

def setUp(self):
super(ModelFilterTest, self)
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a bug - is it supposed to call super(...).setUp()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to work without but...
#98 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants