GNOME Bugzilla – Bug 706025
view: don't hit tracker every time the user scrolls
Last modified: 2013-08-17 12:32:17 UTC
Cache the number of items in the fully loaded view the first time it's needed, and use that value for all future scrolling. Note: if we ever support watching the library for changes, we need to invalidate the cache.
Created attachment 251651 [details] [review] view: don't hit tracker every time the user scrolls
Created attachment 251766 [details] [review] view: don't hit tracker every time the user scrolls Cache the number of items in the fully loaded view the first time it's needed, and use that value for all future scrolling. Note: if we ever support watching the library for changes, we need to invalidate the cache.
Review of attachment 251766 [details] [review]: ::: gnomemusic/view.py @@ +106,3 @@ + if self._cached_count < 0: + self._cached_count = Widgets.get_count(self.countQuery) + return self._cached_count = self._offset Do you mean "return self._cached_count - self._offset" here? The older patch is not the same as the new one. Also it crashes with this: Traceback (most recent call last):
+ Trace 232387
from gnomemusic.application import Application
from gnomemusic.window import Window
import gnomemusic.view as Views
return self._cached_count = self._offset
::: gnomemusic/widgets.py @@ +409,3 @@ + if self._cached_count < 0: + self._cached_count = Widgets.get_count(self.countQuery) + return self._cached_count = self._offset Same as the other one.
Review of attachment 251766 [details] [review]: ::: gnomemusic/widgets.py @@ +20,1 @@ +def get_count(countQuery): This method is renamed and parameters are changed, but a call to this in AllArtistsAlbums._get_remaining_item_count was not updated. @@ +408,3 @@ def _get_remaining_item_count(self): + if self._cached_count < 0: + self._cached_count = Widgets.get_count(self.countQuery) This code is inside widgets.py, so Widgets.get_count should be get_count here.
Comment on attachment 251766 [details] [review] view: don't hit tracker every time the user scrolls I committed a modified version of this patch as 3dc9dcc4b. Sorry, I did a mistake on pushing it, so I reverted it and pushed a new one.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.