fixes bug 1165411 - Optimize modelfilter choices #96
fixes bug 1165411 - Optimize modelfilter choices #96
Conversation
@classmethod | ||
def delete_modelfilter_choices_cache(cls, model): | ||
cache_key = 'modelfilter-choices-%s' % (model._meta,) | ||
# print cache_key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
r+ |
Comments removed and rebased into 1 commit. Your move mister :) |
…h_user-mysql-queries fixes bug 1165411 - Optimize modelfilter choices
Merged and Pushed to stage! :)
|
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) |
There was a problem hiding this comment.
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()
?
There was a problem hiding this comment.
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 :)
@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).