Observed images selected to view from gallery is displayed with some latency

RESOLVED FIXED

Status

Firefox OS
Gaia::Gallery
P2
normal
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: tkundu, Unassigned)

Tracking

({perf})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [caf priority: p2][CR 674618][c=progress p= s= u=])

Attachments

(1 attachment)

Created attachment 8435802 [details]
IMG_0001.jpg

Observed images selected to view from gallery is displayed with some latency.
Steps to reproduce:
1.Open camera.
2.Take few snapshots
3.Now go to gallery to view the images captured.
4.Observed some latency (~ 1.5 sec).

gaia/gecko used:
https://www.codeaurora.org/cgit/quic/lf/b2g/mozilla/gaia/commit/?h=mozilla/v1.4&id=183efb374be1bcbf92f1fb3d0212a68b564a6d3e
https://www.codeaurora.org/cgit/quic/lf/b2g/mozilla/gecko/commit/?h=mozilla/v1.4&id=fb5886a4b48e13f84f48410ba6340deacaf91fa1

Issue is also present in v2.0 


Gallery is spending almost 1 sec inside Decoder::Write() [1] during this period

[1] https://www.codeaurora.org/cgit/quic/lf/b2g/mozilla/gecko/tree/image/src/Decoder.cpp?h=mozilla/v1.4#n90


I attached sample image (captured by camera) which is causing this long delay.
Blocks: 984663
blocking-b2g: --- → 1.4?
Whiteboard: [CR 674618]

Updated

3 years ago
Whiteboard: [CR 674618] → [caf priority: p2][CR 674618]
David,

Since Hema is out can you please look into this?
Component: General → Gaia::Gallery
Flags: needinfo?(dflanagan)
Tapas,

Is the latency you're describing the time that the Gallery is taking to scan the photos? Or just the time to display the photo when you tap on the thumbnail?  If you try tapping on a thumbnail while the gallery app is still scanning (i.e. there is a crawling ants display at the top of the screen) then it is expected to be slow because it is trying to decode the image while also scanning other images.

What device are you testing this on? What is the screen resolution in device pixels?  The EXIF preview in the photo looks suspiciously small to me. IF it is not big enough to fill the device screen, then Gallery will decode the full 5mp image in order to create a thumbnail and an image preview, and that will put a lot of load on the app, making everything slow.  

I suspect that bug 1002593 will help a lot with this.  It has landed on master and should be uplifted to 1.4 soon.

Tapas: please clarify when you're seeing the latency and let me know the device screen size and the size of the embedded EXIF preview (and whether you're using a camera.json customization file). And please test again once 1002593 has landed.  If you're still seeing this bug with that patch, I'll take a look. But if the issues is just that displaying images is slow while we're also scanning images, I don't think we can do anything about that.
Flags: needinfo?(dflanagan)

Updated

3 years ago
Keywords: perf

Updated

3 years ago
Flags: needinfo?(tkundu)
(In reply to David Flanagan [:djf] from comment #2)
> Tapas,
> 
> Is the latency you're describing the time that the Gallery is taking to scan
> the photos?
No. You can see delay even If you open picture after scanning finishes in v1.4

>  If you try tapping on a thumbnail while the gallery app is still
> scanning (i.e. there is a crawling ants display at the top of the screen)
> then it is expected to be slow because it is trying to decode the image
> while also scanning other images.
Yes . I agree. But delay is still > 1.5 secs in v1.4 even if we give it enough time to scan all images.

> 
> What device are you testing this on?

msm8610.

> What is the screen resolution in device
> pixels?
WVGA

> The EXIF preview in the photo looks suspiciously small to me. IF it
> is not big enough to fill the device screen, then Gallery will decode the
> full 5mp image in order to create a thumbnail and an image preview, and that
> will put a lot of load on the app, making everything slow.  
> 

I agree . But we should figure out why Android is doing better than FFOS for this usecase.

> I suspect that bug 1002593 will help a lot with this.  It has landed on
> master and should be uplifted to 1.4 soon.
> 
> Tapas: please clarify when you're seeing the latency and let me know the
> device screen size and the size of the embedded EXIF preview (and whether
> you're using a camera.json customization file). And please test again once
> 1002593 has landed.  If you're still seeing this bug with that patch, I'll
> take a look.

I am testing on it on master and let you know soon.
Can we please test this on 1.3?
It seems like issue is not present in tip of v1.4 now. It seems like it is fixed by some other changes.
Flags: needinfo?(tkundu)

Comment 6

3 years ago
FxOS Perf Triage: closing per comment 5 as fixed.
Status: NEW → RESOLVED
blocking-b2g: 1.4? → ---
Last Resolved: 3 years ago
Priority: -- → P2
Resolution: --- → FIXED
Whiteboard: [caf priority: p2][CR 674618] → [caf priority: p2][CR 674618][c=progress p= s= u=]
You need to log in before you can comment on or make changes to this bug.