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

Fix bug where cached value wasn't used when value was 0 #84

Merged
merged 1 commit into from
May 4, 2015

Conversation

nikolas
Copy link
Member

@nikolas nikolas commented May 2, 2015

When debugging the is_last_child cache, I saw the value
of cache.get() here is either 1, 0, or None if the cached
value isn't present. Currently, only values of 1 are getting
used, because if the value is 0, the if v: to check if
the cache is present fails. I think we need to be more
specific here and do: if v is not None:

This change improved performance a little bit in my local testing
with memcached, but it's still not great: Calling the cache for
each node in the tree takes time, and it would be great to find
a way to interact with the cache just once for the pagetree edit
page.

refs #63

When debugging the `is_last_child` cache, I saw the value
of cache.get() here is either 1, 0, or None if the cached
value isn't present. Currently, only values of 1 are getting
used, because if the value is 0, the `if v:` to check if
the cache is present fails. I think we need to be more
specific here and do: `if v is not None:`

This change improved performance a little bit in my local testing
with memcached, but it's still not great: Calling the cache for
each node in the tree takes time, and it would be great to find
a way to interact with the cache just once for the pagetree edit
page.

refs #63
thraxil added a commit that referenced this pull request May 4, 2015
Fix bug where cached value wasn't used when value was 0
@thraxil thraxil merged commit 55525ec into master May 4, 2015
@thraxil thraxil deleted the cache-bugfix branch December 12, 2016 21: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.

None yet

2 participants