decode-on-draw for Fennec
02.15.11 - 04:40pm
(this is not a feature I coded, but I’m excited about it for Fennec, so here’s the post!)
One thing Fennec struggles with somewhat, especially on pr0nimage-heavy websites is that we can easily be overwhelmed on devices with limited memory by loading lots of large images, including images that aren’t even visible on your screen yet. Bug 622470 addresses this issue by adding some tunable parameters, which are still turned off for Fennec, but which you can experiment with on your own, to see if they help (or hurt) you in your day-to-day usage.
To enable decode-on-draw in Fennec, set the following config parameters in about:config:
image.mem.decodeondraw = true
content.image.allow_locking = false
image.mem.min_discard_timeout_ms = 20000
The final setting determines how long we will hold on to decoded images in memory if they are unused.
These preferences probably won’t be enabled until after beta 5 ships, so to see results, you’ll have to hand edit them as suggested here.
Why decoding it synchronously at all?
you need also “content.image.allow_locking” = “false” pref, to avoid force lock and decoding during page load.
image.mem.max_bytes_for_sync_decode = 15000000 – is just workaround for offscreen images delayed decoding with async mode… so this pref enabling sync mode almost for all images and helping to avoid that problem.
Is it worth it to set image.mem.decodeondraw=true on a desktop machine?