• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category User Interface
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by tpdiffenbach - 2006-06-24
Last edited by jdgordon - 2007-08-04

FS#5591 - Speeds up some list scrolling by a factor of ~12

This patch optimizes apps/gui/list.c, function gui_list_draw.

Previously, all lists were always redrawn in their entirety. With this patch, when the list’s start position (the item at the top of the list) hasn’t changed, only the /lines/ changed are updated. In almost all cases, that means only two lines are updated, the line the cursor is leaving and the line to cursor is moving to. When a list’s start position changes, or when a new list is shown, the whole list is re-drawn using the original cvs code.

Provision is made to handle the “pointer” cursor as well as the standard inverted bar cursor.

The speed increase depends on the font used; the smaller the font, the more lines have to be drawn to fill the screen, and so the greater the speed savings. Here’s a non-controlled sample of the average speeds of the regular and the optimized list redrawing, in microseconds, for several font sizes, on my Ipod Video (G5, 60GB, using only 32MB of memory, that is, build 15):

Font Height Average Unoptimized Average Optimized Ratio of Unoptimized/Optimized
5 123039.71 4555.51 27.01
7 128322.65 15404.24 8.33
14 116112.13 7363.98 15.77
16 128704.18 8046.00 16.00
24 130604.73 20603.50 6.34

For ipods, there’s an often mentioned problem of music play stopping when lists are scrolled. This will not fix the problem, but will alleviate it quite a bit.

Please perform the following experiment before using this patch in build. Using your current build, play a song, then go to the menu and rapidly scroll up and down the list until the music stops playing. Then try the same using a build with this patch. Then do a logfdump (Menu|Info|Debug|logfdump), and mail the file logf.txt in your device’s .rockbox directory to:
gui_list_opt AT


Closed by  jdgordon
2007-08-04 10:01
Reason for closing:  Out of Date

Dave Chapman (linuxstb) notes that the original patch will work only on PP5020 ipods, and only on builds with logf support.

For all other builds, or if you’re unsure your build supports the original patch, use this second patch.

there are some dos line endings in both patches, you might want to watch out for that in the future.

Thanks for pointing that out. I’ll double-check in the future.

How’s this patch coming along ? Is it finished ? Is it worth committing ?
It looks rather promising… Couldn’t it fix some cases where playback was halted by long scrolls ?
I haven’t had time to test it but i’ll try as soon as possible.

It’s still in beta; sorry, I’ve been on vacation or otherwise occupied. I’ll soon update it.

ryran commented on 2006-08-23 04:36

Awesome! Glad to hear! :)

mooch commented on 2006-09-11 20:57

Any progress?


Available keyboard shortcuts


Task Details

Task Editing