Closed Bug 1117307 Opened 10 years ago Closed 6 years ago

[Video][dolphin][FFOS7715 v2.1] [performance] Video app first start-up spend a longer time

Categories

(Firefox OS Graveyard :: Gaia::Video, defect)

ARM
Gonk (Firefox OS)
defect
Not set
major

Tracking

(tracking-b2g:-)

RESOLVED WONTFIX
tracking-b2g -

People

(Reporter: lin.hui, Unassigned)

References

Details

(Keywords: perf, Whiteboard: [SPRD 388908][dp1])

*** Build Information ***
Gaia-Rev        73be51f998031f06db0cd660c0e388fa621c9f4c
Gecko-Rev       30de9395e2c3e4c3d640bc6c70ddbc1a8c8cf88f
Device-Name     dolphin

*** Description ***
Video app first start-up spend a longer time.

*** Steps to Reproduce ***
1.Fill the device with 500 contacts, 50 call logs, 100 sms, 300 images, 150 music,50 videos.
2.Open Video app after device booted 5 min. 
3.Count time consumed until Video open completely.

*** Expected Results ***
The performance of Video start-up in Firefox OS is the same as flame & Android.

*** Actual Results ***
The performance of Video start-up in Firefox OS is worse than flame & Android.

*** The average time ***
7715ea-FFOS :9.136s
Flame-FFOS  :3.365s
7715ea-Android: 1.830s
Severity: normal → major
video app cold start spend longer time.

In video app, the video source is displayed by a quick scan and followed with a full scan.

Filesystem changes discovered by a scan are generally batched. If a scan discovers 10 new files, the information about those files will generally be passed as an array to a the onchange handler rather than calling that handler once for each newly discovered file.  Apps can decide whether to handle batches by processing each element individually or by just starting fresh with a new call to enumerate(). 

In db.js, scan are generally batched, the code like this:
>>  var batch = [];
>>  var batchSize = 4;
and dynamic increasing the batch size:
>>  if (isVideo === true) {
>>    batch.push(videoinfo);
>>    if (batch.length >= batchSize) {
>>      flush();
>>      batchSize *= 2;
In our situation, there have 50 videos in filesystem, so the will displayed followed with 4,8,16,22, then the app displayed completed.

In other hand, the flush function will Interrupt the enumerate, in our point of view, the batch size increasing slowly, what can we do for this scan function and find a better size increasing for the batch?  

Dear vchen:
would you help to find a teammate to check this issue?
Flags: needinfo?(vchen)
Hum....do you try to triple the batchSize to see if indeed there is an improvement of the cold launch time?

Also ni Gary even though i am not sure this one falls into his category...Gary, is it possible for you to comment?

Thanks
Flags: needinfo?(vchen)
Flags: needinfo?(lin.hui)
Flags: needinfo?(gchen)
(In reply to Vance Chen [:vchen][vchen@mozilla.com] from comment #2)
> Hum....do you try to triple the batchSize to see if indeed there is an
> improvement of the cold launch time?

Dear vchen:
I tried to triple the batchSize, but I think for a long-term consideration,triple the batchSize is not a better way, and time consuming is not obviously shortened.

I also tried to change code by this:
>>  batchSize = 5;
Because in vertical screen, video app always displayed 5 items,that we can see them at the first time, when video app loaded.
Then I changed the batchSize by this:
>>  batchSize +=45;
So after displayed the first 5 items, video will enumerate the whole video source in indexedDB and displayed all 45 items in one time.

But there have a bad user experience, when displayed first 5 items, the scroll bar in right couldn't be drag and drop, until the scan finished and displayed the whole 45 items.

In addition, the second scheme greatly shorten the time consuming, but bring a bad experience.
Flags: needinfo?(lin.hui)
(In reply to lin.hui@spreadtrum.com from comment #3)
> (In reply to Vance Chen [:vchen][vchen@mozilla.com] from comment #2)
> > Hum....do you try to triple the batchSize to see if indeed there is an
> > improvement of the cold launch time?
> 
> Dear vchen:
> I tried to triple the batchSize, but I think for a long-term
> consideration,triple the batchSize is not a better way, and time consuming
> is not obviously shortened.
> 
> I also tried to change code by this:
> >>  batchSize = 5;
> Because in vertical screen, video app always displayed 5 items,that we can
> see them at the first time, when video app loaded.
> Then I changed the batchSize by this:
> >>  batchSize +=45;
> So after displayed the first 5 items, video will enumerate the whole video
> source in indexedDB and displayed all 45 items in one time.
> 
> But there have a bad user experience, when displayed first 5 items, the
> scroll bar in right couldn't be drag and drop, until the scan finished and
> displayed the whole 45 items.
> 
> In addition, the second scheme greatly shorten the time consuming, but bring
> a bad experience.

Ya agree, looks like we need to find the balance between the times needed to complete the video scanning and the time user need to wait before he/she can interact with the UI...an algorithm problem here...And what works fine with 50 videos might not work well with 500 videos....

Let's wait to see if our engineer has any idea...
Hi all,
   We think 'batchSize = 5' is the most comfortable for user experience on flame, of course you can customize what you think the best value on you devices.
   Thanks.
Flags: needinfo?(gchen)
Whiteboard: [SPRD 388908] → [SPRD 388908][dp1]
Blocks: 1123554
tracking-b2g: --- → -
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.