New issue
Advanced search Search tips

Issue 669835 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Streamline image decoding service

Project Member Reported by finnur@chromium.org, Nov 30 2016

Issue description

The image decoding service could do with some streamlining.

At the moment, the biggest problems are the lag in getting to the first decode (1.7s, counting only from when the C++ layer sees the request) and lag in subsequent decodes (1.5s). Any lag in the request being issued in Java and jumping over to C++ and back is additional to this.

Also the fact that to convert from full size images to thumbnails we decode images full size (290ms for Nexus 6 photos) and then shrink them down until they fit (another 260ms). Note: All numbers taken from my local Debug build. In comparison, Android has inSampleSize option for decoding thumbnails in one step in less than 300 ms.

The C++ uses a Blink decoder in a sandboxed process, so starting the service is very expensive. The process has to initialize base, content, v8, blink and layers of other stuff used by all of them.

A low-hanging fruit is to not shut the service down until 5 seconds of inactivity have passed. That allows it to be re-used for multiple requests. Sub-sampling (if Blink supports it) would be another low-hanging fruit.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0798a4585e6cb5df5e5596b8692656fca669cc28

commit 0798a4585e6cb5df5e5596b8692656fca669cc28
Author: rockot <rockot@chromium.org>
Date: Fri Dec 02 01:43:32 2016

image_decoder: Delay shutdown on idle

Instead of immediately tearing down the image_decoder service
once it's idle, wait 5 seconds in case there are going to be
more requests soon.

This mirrors the behavior of utility process image decoding
prior to servicification, and is intended to address latency
issues with multiple image decodes happening in quick (but not
quite immediate) succession.

BUG=669835

Review-Url: https://codereview.chromium.org/2538833004
Cr-Commit-Position: refs/heads/master@{#435815}

[modify] https://crrev.com/0798a4585e6cb5df5e5596b8692656fca669cc28/services/image_decoder/image_decoder_service.cc
[modify] https://crrev.com/0798a4585e6cb5df5e5596b8692656fca669cc28/services/image_decoder/image_decoder_service.h

Project Member

Comment 2 by bugdroid1@chromium.org, Dec 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7438bbcf5741f228b5c4059ab266dee53fcace62

commit 7438bbcf5741f228b5c4059ab266dee53fcace62
Author: rockot <rockot@chromium.org>
Date: Fri Dec 02 14:04:48 2016

Revert of image_decoder: Delay shutdown on idle (patchset #1 id:1 of https://codereview.chromium.org/2538833004/ )

Reason for revert:
I did something stupid. Trivial UAF, will fix.

Original issue's description:
> image_decoder: Delay shutdown on idle
>
> Instead of immediately tearing down the image_decoder service
> once it's idle, wait 5 seconds in case there are going to be
> more requests soon.
>
> This mirrors the behavior of utility process image decoding
> prior to servicification, and is intended to address latency
> issues with multiple image decodes happening in quick (but not
> quite immediate) succession.
>
> BUG=669835
>
> Committed: https://crrev.com/0798a4585e6cb5df5e5596b8692656fca669cc28
> Cr-Commit-Position: refs/heads/master@{#435815}

TBR=ben@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=669835

Review-Url: https://codereview.chromium.org/2544313002
Cr-Commit-Position: refs/heads/master@{#435932}

[modify] https://crrev.com/7438bbcf5741f228b5c4059ab266dee53fcace62/services/image_decoder/image_decoder_service.cc
[modify] https://crrev.com/7438bbcf5741f228b5c4059ab266dee53fcace62/services/image_decoder/image_decoder_service.h

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7132d89aa639d928f4fa72adfac66aebbe660d50

commit 7132d89aa639d928f4fa72adfac66aebbe660d50
Author: rockot <rockot@chromium.org>
Date: Sat Dec 03 01:05:45 2016

image_decoder: Delay shutdown on idle

Instead of immediately tearing down the image_decoder service
once it's idle, wait 5 seconds in case there are going to be
more requests soon.

This mirrors the behavior of utility process image decoding
prior to servicification, and is intended to address latency
issues with multiple image decodes happening in quick (but not
quite immediate) succession.

BUG=669835

Committed: https://crrev.com/0798a4585e6cb5df5e5596b8692656fca669cc28
Review-Url: https://codereview.chromium.org/2538833004
Cr-Original-Commit-Position: refs/heads/master@{#435815}
Cr-Commit-Position: refs/heads/master@{#436113}

[modify] https://crrev.com/7132d89aa639d928f4fa72adfac66aebbe660d50/services/image_decoder/image_decoder_service.cc
[modify] https://crrev.com/7132d89aa639d928f4fa72adfac66aebbe660d50/services/image_decoder/image_decoder_service.h

Cc: roc...@chromium.org
Owner: finnur@chromium.org
Based on your other comments it sounds like you have have additional plans for the decoder service. I don't know if that should be a separate metabug or something, but I'll pass this onto you now that my bug is fixed. :)
Cc: -roc...@chromium.org rockot@google.com

Sign in to add a comment