FS#12361 - Smart settings_load_config() so it only does setting_apply() if required

Attached to Project: Rockbox
Opened by Jonathan Gordon (jdgordon) - Tuesday, 01 November 2011, 10:49 GMT
Task Type Patches
Category Settings
Status New
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.9
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


in svn settings_apply() is called whenever a config is loaded (after boot) regardless of what is in the file. even an empty one will cause a full settings_apply() (which is slow, causes disk access and will stop music thanks to the buflib users).

This patch will apply settings individually if they have a callback registered, and if no settings without a callback are applied it doesnt bother calling settings_apply().
This task depends upon

Comment by Jonathan Gordon (jdgordon) - Tuesday, 01 November 2011, 11:10 GMT
And apply this one after which moves to fast_readline. Benchmarking on my CF-ed video shows no difference at all (with or without this part of the patch), need someone with a spindle device to benchmark
Comment by Boris Gjenero (dreamlayers) - Tuesday, 20 December 2011, 20:44 GMT
On both 5G 30GB iPod and Archos Recorder V2, both with original hard drives, there is a small speedup with smart_settings_apply.diff. It's just a fraction of a second though. I'm don't know how to measure such a small change. With the patch, the splash(HZ, ID2P(LANG_SETTINGS_LOADED)); stands out more as a waste of time. I think the speedup is only really beneficial if that wait is removed also.

In my opinion, avoiding music interruption due to buflib is far more important than the tiny speedup. However, I'm not sure when this would help now. It seems settings_apply_skins() causes the interruption, and it's conditional on theme_changed.

I'm attaching a resynced patch. I did not try 0002-Move-to-fast_readline.patch because it is harder to resync.