decode-on-draw for Fennec

(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.

The Conversation {3 comments}

  1. Paolo {Tuesday February 15, 2011 @ 5:02 pm}

    Why decoding it synchronously at all?

  2. romaxa {Tuesday February 15, 2011 @ 7:23 pm}

    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.

  3. geeknik {Monday February 21, 2011 @ 4:39 pm}

    Is it worth it to set image.mem.decodeondraw=true on a desktop machine?

Leave a Comment

  • Comment Policy:Could go here if there's a nagging need Login Instructions: Would go here if there's a desire.