Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#11799 - Less disk activity patch for text viewer plugin

Attached to Project: Rockbox
Opened by Alexander Meshcheryakov (Self-Perfection) - Wednesday, 08 December 2010, 21:47 GMT+2
Last edited by MichaelGiacomelli (saratoga) - Tuesday, 14 December 2010, 22:34 GMT+2
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Release 3.7.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

Current text viewer is very greedy for disk accesses. This is very annoying on HDD based players. For example, I've expirienced more 5 seconds pauses after "quit" command. This patch changes how saving preferences happens, so in most cases quiting text viewer plugin on HDD based player would be instant.

Fixed:
- tv_save_settings() were called twice upon exiting doubling all disk activity
- if tv_file.dat already had record for current file when preferences were saved tv_file.dat grew one record of garbage

Changed:
- Much more efficient code for saving preferences. Do not dawdle with temporary tv_file.tmp if this text is opened for the first time or there were no bookmark adding/removals since text were opened.
- Saving settings on exit only if preferences or bookmarks were changed since plugin start or text were scrolled. On devices with HAVE_DISK_STORAGE defined scrolling is ignored.
   less_spinups.diff (13.9 KiB)
 apps/plugins/text_viewer/tv_settings.c    |  127 +++++++++++++++++++-----------
 apps/plugins/text_viewer/tv_preferences.c |    7 +
 apps/plugins/text_viewer/tv_menu.c        |    2 
 apps/plugins/text_viewer/tv_bookmark.c    |   16 ---
 apps/plugins/text_viewer/tv_settings.h    |    1 
 apps/plugins/text_viewer/tv_preferences.h |   10 ++
 apps/plugins/text_viewer/tv_bookmark.h    |    3 
 apps/plugins/text_viewer/tv_action.c      |   27 ++++--
 8 files changed, 130 insertions(+), 63 deletions(-)

This task depends upon

Closed by  MichaelGiacomelli (saratoga)
Tuesday, 14 December 2010, 22:34 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  Committed in r28833.

Loading...