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

Queryset cache using sparse list update #1682

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

wetneb
Copy link

@wetneb wetneb commented Jul 29, 2019

This is an update of #1451, using the released version of sparse_list.

I will test this in production and report back.

acdha and others added 4 commits July 29, 2019 07:54
The sparse list implementation avoids allocating the result cache
elements until something triggers loading the actual content.

This has a slight memory increase for very small querysets – roughly a
custom class + dict() vs. a list() – but the actual result data will
usually be much larger and the difference is cancelled out by the time
the result cache is at a thousand items.

This branch is currently broken using the released version of
sparse_list – see johnsyweb/python_sparse_list#5
This bit of code really needs to be rewritten to avoid the loop but this
patch at least hits the point of being testable on Python 2
Following a rapid upstream release, this should get the tests in django-haystack#1117 to pass against Python 3.
@wetneb wetneb force-pushed the queryset-cache-using-sparse_list-update branch from a30d37d to b18a1df Compare July 29, 2019 07:02
@wetneb
Copy link
Author

wetneb commented Jul 29, 2019

Tests are currently failing because of johnsyweb/python_sparse_list#12.

acdha
acdha previously approved these changes Aug 19, 2019
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.

None yet

2 participants