[Camera][dolphin][FFOS7715 v2.1] [performance] Using Camera app take a picture spend longer time.

RESOLVED FIXED

Status

--
major
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: lin.hui, Assigned: behsieh)

Tracking

({perf})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [SPRD 388583][dp2])

Attachments

(6 attachments, 3 obsolete attachments)

(Reporter)

Description

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

*** Description ***
Using Camera app take a picture spend longer time.

*** Steps to Reproduce ***
1.Fill the device with 250 contacts, 50 call logs, 100 sms, 300 images, 150 music, 50 videos.
2.Open Camera app.
3.Take a picture.
3.Count time consumed started by click take-picture button, and end by the picture‘s Preview displayed in left bottom.

*** Expected Results ***
The performance of using Camera app to take a picture is same as flame & android. 

*** Actual Results ***
The performance of using Camera app to take a picture is worse than flame & android. 

*** The average time ***
7715ea-FFOS :2.701s
Flame-FFOS  :1.879s
7715ea-android:1.723s
(Assignee)

Updated

4 years ago
Assignee: nobody → behsieh

Comment 1

4 years ago
I push the same code into Flame and SPRD_7715ea, It cost different time during take-picture.

The log  >>>
Flame2.1:
06-01 08:03:03.909   I GeckoDump: wjc : click:capture
06-01 08:03:03.909   I GeckoDump: wjc : takePicture start            + 0ms
06-01 08:03:04.919   I GeckoDump: wjc : onFocused                    + 1010ms 
06-01 08:03:04.929   I GeckoDump: wjc : takePicture really
06-01 08:03:06.069   I GeckoDump: wjc : takePicture onSuccess        + 1150ms
06-01 08:03:06.069   I GeckoDump: wjc : emit newimage
06-01 08:03:06.069   I GeckoDump: wjc : creatFilename start
06-01 08:03:06.109   I GeckoDump: wjc : creatFilename end            + 40ms
06-01 08:03:06.109   I GeckoDump: wjc : store image start
06-01 08:03:06.299   I GeckoDump: wjc : store image onsuccess        + 190ms
06-01 08:03:06.299   I GeckoDump: wjc : refetch image start
06-01 08:03:06.349   I GeckoDump: wjc : refetch image onsuccess      + 50ms
06-01 08:03:06.349   I GeckoDump: wjc : emit newmedia
06-01 08:03:06.349   I GeckoDump: wjc : preparePreview start
06-01 08:03:06.429   I GeckoDump: wjc : preparePreview end           + 80ms
06-01 08:03:06.429   I GeckoDump: wjc : createThumbnailImage start
06-01 08:03:06.449   I GeckoDump: wjc : createThumbnailImage end     + 20ms
06-01 08:03:06.469   I GeckoDump: wjc : emit newthumbnail
06-01 08:03:06.469   I GeckoDump: wjc : display thumbnail start
06-01 08:03:06.469   I GeckoDump: wjc : display thumbnail end        + 20ms
                                                                 total: 2560ms
7715ea:
01-09 02:49:04.665   I GeckoDump: wjc : click:capture
01-09 02:49:04.665   I GeckoDump: wjc : takePicture start            + 0ms
01-09 02:49:05.575   I GeckoDump: wjc : onFocused                    + 910ms
01-09 02:49:05.625   I GeckoDump: wjc : takePicture really
01-09 02:49:07.175   I GeckoDump: wjc : takePicture onSuccess        + 1600ms
01-09 02:49:07.175   I GeckoDump: wjc : emit newimage
01-09 02:49:07.175   I GeckoDump: wjc : creatFilename start
01-09 02:49:08.145   I GeckoDump: wjc : creatFilename end            + 970ms
01-09 02:49:08.145   I GeckoDump: wjc : store image start
01-09 02:49:08.685   I GeckoDump: wjc : store image onsuccess        + 540ms
01-09 02:49:08.695   I GeckoDump: wjc : refetch image start
01-09 02:49:08.925   I GeckoDump: wjc : refetch image onsuccess      + 230ms
01-09 02:49:08.935   I GeckoDump: wjc : emit newmedia
01-09 02:49:08.935   I GeckoDump: wjc : preparePreview start
01-09 02:49:09.065   I GeckoDump: wjc : preparePreview end           + 130ms
01-09 02:49:09.065   I GeckoDump: wjc : createThumbnailImage start
01-09 02:49:09.095   I GeckoDump: wjc : createThumbnailImage end     + 30ms
01-09 02:49:09.115   I GeckoDump: wjc : emit newthumbnail
01-09 02:49:09.125   I GeckoDump: wjc : display thumbnail start
01-09 02:49:09.125   I GeckoDump: wjc : display thumbnail end        + 30ms
                                                                 total: 4440ms

The main point of difference:
takePicture           450ms
creatFilename         930ms
store image           350ms
refetch image         180ms



I think there is something wrong with SPRD-QA's test steps.
7715ea-FFOS :2.701s
Flame-FFOS  :1.879s
7715ea-android:1.723s
 In Comment 1, the value of 7715ea-FFOS's costed time and Flame-FFOS's costed time is too low. Please ignore.



Hi behsieh:
    Did you have some fadeback? thanks very much.
Flags: needinfo?(behsieh)

Comment 2

4 years ago
Hi jinchao.wang,

May I confirm that the Flame 2.1 you test is single core or multi core?
Flags: needinfo?(jinchao.wang)
(Assignee)

Comment 3

4 years ago
hi jinchao
2 quick questions

1.is it only could reproduce under below condition
"Fill the device with 250 contacts, 50 call logs, 100 sms, 300 images, 150 music, 50 videos."
I just use clean rom and it looks like the same snapshot speed with flame

2. did you put the same condition("Fill the device with 250 contacts, 50 call logs, 100 sms, 300 images, 150 music, 50 videos.") on flame also?

thanks

Comment 4

4 years ago
(In reply to Vincent Liu[:vliu] from comment #2)
> Hi jinchao.wang,
> 
> May I confirm that the Flame 2.1 you test is single core or multi core?

Hi  Vincent Liu:
   Flame that I use is single core. thanks for you response.
Flags: needinfo?(jinchao.wang)

Comment 5

4 years ago
(In reply to becker hsieh{:behsieh} from comment #3)
> hi jinchao
> 2 quick questions
> 
> 1.is it only could reproduce under below condition
> "Fill the device with 250 contacts, 50 call logs, 100 sms, 300 images, 150
> music, 50 videos."
> I just use clean rom and it looks like the same snapshot speed with flame
> 
> 2. did you put the same condition("Fill the device with 250 contacts, 50
> call logs, 100 sms, 300 images, 150 music, 50 videos.") on flame also?
> 
> thanks

Hi becker hsieh:
    When I reproduce, I didn't fill the device with " 250 contacts …… 50 videos" either on flame or on SPRD7715ea. I don't think the preset condition is important.
    In my test, Flame2.1 cost less time than SPRD7715ea when they are under the same condition.
(Assignee)

Comment 6

4 years ago
Hi jinchao:
i use dolphin branch 2.1s and I also check snapshot latency on both flame and dolphin.
looks like it take around 400ms shutter on both device (flame and dolphin.)
can you try it on 2.1s
thank you
Flags: needinfo?(behsieh)

Updated

4 years ago
Whiteboard: [SPRD 388583] → [SPRD 388583][dp2]
(Assignee)

Comment 7

4 years ago
hi jinchao:
any update on this issue?
thanks
Flags: needinfo?(jinchao.wang)

Comment 8

4 years ago
(In reply to becker hsieh{:behsieh} from comment #7)
> hi jinchao:
> any update on this issue?
> thanks

Hi becker hsieh:
    We didn't have the code of 2.1s. So I can't do the test. Sorry.

    In my test, Dophin is slower than Flame, because Dophin is slow when it do action of storage.get, db.transaction, picture.addNamed and so on.
Flags: needinfo?(jinchao.wang)
(In reply to jinchao.wang from comment #8)
> (In reply to becker hsieh{:behsieh} from comment #7)
> > hi jinchao:
> > any update on this issue?
> > thanks
> 
> Hi becker hsieh:
>     We didn't have the code of 2.1s. So I can't do the test. Sorry.
> 
>     In my test, Dophin is slower than Flame, because Dophin is slow when it
> do action of storage.get, db.transaction, picture.addNamed and so on.

Hi Jinchao -

In fact we just branch out the 2.1s, I believe you should be able to get it now. Could you check with Siiaceon to see if you already integrate the newest FFOS 2.1s into your local github?

Thanks
Flags: needinfo?(siiaceon.cao)
Flags: needinfo?(jinchao.wang)

Updated

4 years ago
Blocks: 1123554
(Assignee)

Comment 10

4 years ago
Hi jinchao:
please let us know the status? snapshot performance on v2.1s
thanks

Comment 11

4 years ago
Hi becker hsieh:
    We didn't has plan on 2.1s, so that Spreadtrum didn't build 2.1s version. So I can't do the test on 2.1s.

    In my test on 2.1, Time cost by 7715ea on focus and takePicture is similar to 2.1Flame. But 7715ea cost more time than 2.1s on storing image about 0.8s after the image returned by hardware to gaia. I think the storage write/read performance of 7715ea is bad than Flmae. I know it's 7715ea's IO or hardware issue maybe. So if we can do some optimization to work round ? For example, we show thumbnail first, then to store image.
    did you has any idea?
Flags: needinfo?(jinchao.wang)
Hi JinChao -

Let me clarify something first. The branch 2.1s is derived from 2.1, and it is specifically for SPRD on the FFOS 2.1 development. So eventually SPRD will take 2.1s instead of 2.1.

You can check with Siiceon/Jason/Irvin about the detail

Thanks
Flags: needinfo?(jinchao.wang)

Comment 13

4 years ago
(In reply to becker hsieh{:behsieh} from comment #6)
> Hi jinchao:
> i use dolphin branch 2.1s and I also check snapshot latency on both flame
> and dolphin.
> looks like it take around 400ms shutter on both device (flame and dolphin.)
> can you try it on 2.1s
> thank you

Hi becker :
   what is about 400ms?  It is from gecko::takePicture to gecko::onShutter ?

   As far as I know:
   gaia::takePicture  >>  gecko::takePicture  >> android::takePicture
   then, callback gecko::onShutter   >>  gaia play shutter sound
   then, callback gecko::onSuccesee  >>  gaia receive image from hardware, then to store image and display thumbnail.

Comment 14

4 years ago
(In reply to Vance Chen [:vchen][vchen@mozilla.com] from comment #12)
> Hi JinChao -
> 
> Let me clarify something first. The branch 2.1s is derived from 2.1, and it
> is specifically for SPRD on the FFOS 2.1 development. So eventually SPRD
> will take 2.1s instead of 2.1.
> 
> You can check with Siiceon/Jason/Irvin about the detail
> 
> Thanks

Hi Vance:
   I has discussed with Siiaceon/Irving , I known eventually SPRD will take 2.1s instead of 2.1 . But now we didn't build this version. I will try it on 2.1s when we have .
   Thanks for your clarification.
Flags: needinfo?(siiaceon.cao)
Flags: needinfo?(jinchao.wang)

Comment 15

4 years ago
Hi Vance & becker:
    I need to clarify that the whole process of snapshot is from view of capture button clicked to thumbnail display on the lower left corner of screen.

    As comment 11 and comment 13,In my test on 2.1. Before onSuccess of mozCamera.takePicture, the time cost by 7715ea is similar to Flame2.1. 
    But after onSuccess of mozCamera.takePicture,7715ea cost more time than Flame2.1 on storing image about 0.8s after the image returned by hardware to gaia.
    I think the storage's write/read performance of 7715ea is bad than Flame. I know it's 7715ea's IO or hardware issue maybe.I need mozilla engineer to take a look on this issue. whether mozilla engineer has the same conclusion with me ? After onSuccess of mozCamera.takePicture, with storing image and displaying thumbnail, it will do one storage writing, two storage reading and one indexedDB writing.
    thanks!
Flags: needinfo?(vchen)
Flags: needinfo?(behsieh)
(Assignee)

Comment 16

4 years ago
Hi Jinchao:
I just apply your patch and here is my performance
looks like it takes aroung 2.8ms from take picture start till picture storage.
02-06 05:31:40.519 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:9308 in ControlsController.prototype.onCaptureClick: wjc <1> onCaptureClick 
02-06 05:31:40.569 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:6063 in takePicture: wjc <3> takePicture  start 
02-06 05:31:41.919 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:6083 in onSuccess: wjc <3> takePicture  end 
02-06 05:31:41.929 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/controllers/storage.js:122 in StorageController.prototype.storePicture: wjc <4> addPicture  start  { 
02-06 05:31:41.949 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:12415 in Storage.prototype.addPicture: wjc <5> createFilename  start 
02-06 05:31:42.799 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:12424 in onCreated: wjc <5> createFilename  end
02-06 05:31:42.799 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:12425 in onCreated: wjc <6> addNamed  start
02-06 05:31:43.109 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:12429 in Storage.prototype.addPicture/onCreated/req.onsuccess: wjc <6> addNamed  end
02-06 05:31:43.109 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:12440 in refetchFile: wjc <7> refetchFile  start
02-06 05:31:43.189 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:12447 in Storage.prototype.addPicture/refetchFile/req.onsuccess: wjc <7> refetchFile  end
02-06 05:31:43.209 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/controllers/storage.js:126 in StorageController.prototype.storePicture/<: wjc <4> addPicture  end  } 
02-06 05:31:43.209 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/controllers/preview-gallery.js:302 in PreviewGalleryController.prototype.onNewMedia: wjc <8> preparePreview  start
02-06 05:31:43.289 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/controllers/preview-gallery.js:304 in PreviewGalleryController.prototype.onNewMedia/<: wjc <8> preparePreview  end
02-06 05:31:43.289 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/controllers/preview-gallery.js:377 in PreviewGalleryController.prototype.updateThumbnail: wjc <9> updateThumbnail  start
02-06 05:31:43.339 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/controllers/preview-gallery.js:421 in gotThumbnail: wjc <9> updateThumbnail  end
02-06 05:31:43.339 E/GeckoConsole( 3521): Content JS LOG at app://camera.gaiamobile.org/js/main.js:9044 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!

thanks
Flags: needinfo?(behsieh)

Comment 17

4 years ago
Created attachment 8561224 [details] [diff] [review]
camera.patch

Comment 18

4 years ago
Hi becker:
Flags: needinfo?(behsieh)

Comment 19

4 years ago
Hi becker:
    I checked our patch on our side code. I found , because I disabled continuousAutoFocus , so it will take a lot time to focus , after focused then take picture. It will take about 3 seconds to take a picture.

    So I enabled continuousAutoFocus agian.  But I found another issue. When camera cold start, the foucus ring won't disappear. If you want to reproduce this issue, please be careful, after camera cold start, you should don't do any operation to the application ,including touch the screen. The focus ring will display and won't disappear unless you take picture or touch screen.

Comment 20

4 years ago
Created attachment 8561230 [details] [diff] [review]
continuousAutoFocus diable

continuousAutoFocus diable, 2.5s >>>>>>>>>>>>>>>
02-09 02:04:06.918  1008  1008 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9310 in ControlsController.prototype.onCaptureClick: wjc <1> onCaptureClick 
02-09 02:04:06.918  1008  1008 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6053 in Camera.prototype.takePicture: wjc do focus
02-09 02:04:07.598  1008  1008 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6060 in onFocused: wjc onFocused
02-09 02:04:08.738  1008  1008 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6085 in onSuccess: wjc takePicture onSeccess
02-09 02:04:09.468  1008  1008 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9046 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!


continuousAutoFocus enable , 1.7s >>>>>>>>>>>>>>>
02-09 02:09:51.638  1189  1189 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9311 in ControlsController.prototype.onCaptureClick: wjc <1> onCaptureClick 
02-09 02:09:51.648  1189  1189 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6056 in Camera.prototype.takePicture: wjc focused, takePicture directly
02-09 02:09:52.588  1189  1189 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6086 in onSuccess: wjc takePicture onSeccess
02-09 02:09:53.358  1189  1189 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9047 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
Attachment #8561224 - Attachment is obsolete: true

Comment 21

4 years ago
As comment 19, when enable continuousAutoFocus,  When camera cold start, if the foucus ring display and it won't disappear. Because mozCamera.onAutoFocusMoving will be callback(ring display), but onAutoFocusCompleted won't be callback(ring disappear).

Comment 22

4 years ago
Created attachment 8563906 [details] [diff] [review]
camera_prime.patch
Attachment #8561230 - Attachment is obsolete: true

Comment 23

4 years ago
Created attachment 8563907 [details] [diff] [review]
camera_2.1_sprd.patch

Comment 24

4 years ago
Created attachment 8563908 [details] [diff] [review]
camera_1.4_sprd.patch

patch on firefox 1.4 .

Comment 25

4 years ago
Hi All:

Prime gaia/camera apply the patch of camera_prime.patch( comment 22 ), make install-gaia the code to dolphin(7715ea), it will cost about 1.3 seconds to store image after onSuccess of takePicture.
【1.29s】
02-12 13:45:24.146  1620  1620 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6083 in onSuccess: wjc takePicture onSeccess
02-12 13:45:25.456  1620  1620 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9044 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【1.310s】
02-12 13:46:01.886  1620  1620 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6083 in onSuccess: wjc takePicture onSeccess
02-12 13:46:03.196  1620  1620 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9044 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【1.480s】
02-12 13:47:09.226  1620  1620 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6083 in onSuccess: wjc takePicture onSeccess
02-12 13:47:10.706  1620  1620 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9044 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【1.470s】
02-12 13:48:03.536  1620  1620 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6083 in onSuccess: wjc takePicture onSeccess
02-12 13:48:05.006  1620  1620 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9044 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!


Prime gaia/camera apply the patch of camera_prime.patch( comment 22 ), make install-gaia the code to Flame, it will cost about 1.3 seconds to store image after onSuccess of takePicture.
【0.41s】
06-01 12:21:33.769  1609  1609 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6083 in onSuccess: wjc takePicture onSeccess
06-01 12:21:34.179  1609  1609 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9044 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【0.38s】
06-01 12:22:21.319  1609  1609 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6083 in onSuccess: wjc takePicture onSeccess
06-01 12:22:21.699  1609  1609 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9044 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【0.84s】
06-01 12:22:57.839  1609  1609 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6083 in onSuccess: wjc takePicture onSeccess
06-01 12:22:58.679  1609  1609 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9044 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【0.39s】
06-01 12:23:26.999  1609  1609 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6083 in onSuccess: wjc takePicture onSeccess
06-01 12:23:27.389  1609  1609 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9044 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【We can see, Flame is faster than dolphin_7715ea to store image.】


I applay Complete_sprd_patch (camera_2.1_sprd.patch as comment 23 )to gaia/camera,make install-gaia the code to dolphin(7715ea), it will cost about 1.3 seconds to store image after onSuccess of takePicture.
【1.360s】
02-12 14:09:49.955  2678  2678 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6089 in onSuccess: wjc <3> takePicture  onSuccess @ @ @ @ @ @
02-12 14:09:51.315  2678  2678 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9087 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【1.520s】
02-12 14:11:17.375  2678  2678 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6089 in onSuccess: wjc <3> takePicture  onSuccess @ @ @ @ @ @
02-12 14:11:18.895  2678  2678 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9087 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【1.31s】
02-12 14:12:03.805  2678  2678 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6089 in onSuccess: wjc <3> takePicture  onSuccess @ @ @ @ @ @
02-12 14:12:05.115  2678  2678 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9087 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【1.35s】
02-12 14:13:18.345  2678  2678 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6089 in onSuccess: wjc <3> takePicture  onSuccess @ @ @ @ @ @
02-12 14:13:19.695  2678  2678 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:9087 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!!
【We can see, sprd patch didn't consume the performance of dolphin_7715ea about takePicture】

Comment 26

4 years ago
As comment 24 . I did the same test on version of Firefox 1.4 .
7715ga only cost 0.7 seconds to store image.

09-27 23:14:52.380   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6686 in ControlsController.prototype.onCaptureClick: wjc <1> onCaptureClick
09-27 23:14:54.300   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:4120 in onSuccess: wjc takePicture onSuccess
09-27 23:14:54.300   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:3442 in Storage.prototype.addImage: wjc <5> createFilename  start
09-27 23:14:54.530   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:3451 in onCreated: wjc <5> createFilename  end
09-27 23:14:54.540   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:3452 in onCreated: wjc <6> addNamed  end
09-27 23:14:54.880   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:3456 in Storage.prototype.addImage/onCreated/req.onsuccess: wjc <6> addNamed  end
09-27 23:14:54.880   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:3465 in refetchImage: wjc <7> refetchFile  start
09-27 23:14:54.980   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:3469 in Storage.prototype.addImage/refetchImage/req.onsuccess: wjc <7> refetchFile  end
09-27 23:14:54.980   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:11515 in PreviewGalleryController.prototype.onNewMedia: wjc <8> preparePreview  start
09-27 23:14:55.050   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:11517 in PreviewGalleryController.prototype.onNewMedia/<: wjc <8> preparePreview  end
09-27 23:14:55.050   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:11590 in PreviewGalleryController.prototype.updateThumbnail: wjc <9> updateThumbnail  start
09-27 23:14:55.080   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:11634 in gotThumbnail: wjc <9> updateThumbnail  end
09-27 23:14:55.080   734   734 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:6483 in module.exports<.setThumbnail: wjc <10> updateThumbnail  set, and capture process end!!!!!!!
(Assignee)

Comment 27

4 years ago
hi jinchao:
looks like in dcf.js storage.get(filepath);  take too much time.
can you break down in hal layer /AOSP layer or kernel layer to check?

below is my log.

store image in dolphin 170ms for once
02-13 04:19:35.700  1061  1061 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12303 in exports.createDCFFilename: wjc storage.get E
02-13 04:19:35.720  1061  1061 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12308 in exports.createDCFFilename: wjc storage.get X
02-13 04:19:35.890  1061  1061 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12312 in exports.createDCFFilename/req.onsuccess: wjc onsuccess

store image in flame take 10 ms
02-13 03:31:25.869  4598  4598 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12303 in exports.createDCFFilename: wjc storage.get E
02-13 03:31:25.869  4598  4598 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12308 in exports.createDCFFilename: wjc storage.get X
02-13 03:31:25.879  4598  4598 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12312 in exports.createDCFFilename/req.onsuccess: wjc storage.get done
Flags: needinfo?(behsieh)
(Assignee)

Comment 28

4 years ago
Created attachment 8564013 [details] [diff] [review]
camera_storage.patch

add log in dcf.js
Agree with Becker, I think most time should be spent in HAL or kernel side.
If you find HAL or kernel didn't cost so much time, it would be a useful information.
In the same time, Mozilla will try to break down in gecko part as well.


(In reply to becker hsieh{:behsieh} from comment #27)
> hi jinchao:
> looks like in dcf.js storage.get(filepath);  take too much time.
> can you break down in hal layer /AOSP layer or kernel layer to check?
> 
> below is my log.
> 
> store image in dolphin 170ms for once
> 02-13 04:19:35.700  1061  1061 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12303 in exports.createDCFFilename:
> wjc storage.get E
> 02-13 04:19:35.720  1061  1061 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12308 in exports.createDCFFilename:
> wjc storage.get X
> 02-13 04:19:35.890  1061  1061 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12312 in
> exports.createDCFFilename/req.onsuccess: wjc onsuccess
> 
> store image in flame take 10 ms
> 02-13 03:31:25.869  4598  4598 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12303 in exports.createDCFFilename:
> wjc storage.get E
> 02-13 03:31:25.869  4598  4598 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12308 in exports.createDCFFilename:
> wjc storage.get X
> 02-13 03:31:25.879  4598  4598 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12312 in
> exports.createDCFFilename/req.onsuccess: wjc storage.get done

Comment 30

4 years ago
(In reply to becker hsieh{:behsieh} from comment #27)
(In reply to Alphan Chen[:Alphan] from comment #29)

Hi both:
    I agree with you too. I will check time spent in HAL or kernel side when read or write file from storage.

    Beside, I think, the correct process is from storage.get to onerror. No file existed is what we want. I will update camera_storage.patch.

    thanks!

Comment 31

4 years ago
Created attachment 8564645 [details] [diff] [review]
camera_2.1_mozilla_storage.patch

Flame only need 0.02 seconds:
12-10 11:51:59.214  1154  1154 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12303 in exports.createDCFFilename: wjcc storage.get E
12-10 11:51:59.224  1154  1154 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12308 in exports.createDCFFilename: wjcc storage.get X
12-10 11:51:59.234  1154  1154 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12322 in exports.createDCFFilename/req.onerror: wjcc onerror


7715ea cost 0.51 seconds:
02-15 11:04:35.577   823   823 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12303 in exports.createDCFFilename: wjcc storage.get E
02-15 11:04:35.597   823   823 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12308 in exports.createDCFFilename: wjcc storage.get X
02-15 11:04:36.087   823   823 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12322 in exports.createDCFFilename/req.onerror: wjcc onerror


7715ga cost 0.15 seconds:
09-26 11:03:24.541   709   709 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:3353 in exports.createDCFFilename: wjcc storage.get E
09-26 11:03:24.541   709   709 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:3355 in exports.createDCFFilename: wjcc storage.get X
09-26 11:03:24.691   709   709 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:3369 in exports.createDCFFilename/req.onerror: wjcc onerror

Comment 32

4 years ago
Created attachment 8564646 [details] [diff] [review]
camera_1.4_sprd.patch
Attachment #8563908 - Attachment is obsolete: true
Hi jinchao:
Is "storage.get" the case which you want to break down?
To accelerate the progress, could you point out the function you like to break down?
Flags: needinfo?(jinchao.wang)
Created attachment 8564887 [details] [diff] [review]
Add log in gecko for breakdown

Hi jinchao,
Here is how we add log in gecko for device storage part.
You can follow this patch and add the log by your own.
Thanks.

Comment 35

4 years ago
(In reply to Alphan Chen[:Alphan] from comment #34)
> Created attachment 8564887 [details] [diff] [review]
> Add log in gecko for breakdown
> 
> Hi jinchao,
> Here is how we add log in gecko for device storage part.
> You can follow this patch and add the log by your own.
> Thanks.

Hi  Alphan:
    Starting point is "storage.get".
    break down point is "req.onerror" not "req.onsuccess".

    I will to take a vacation. I will back after the Spring Festival. 

    thanks, happy new year.
Flags: needinfo?(jinchao.wang)
(Assignee)

Comment 36

4 years ago
req.onerror is callback when get ok filename
inside req.onerror actually not cost too much time
02-25 04:51:06.479  3239  3239 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12329 in exports.createDCFFilename/req.onerror: wjc onerror E DCIM/100MZLLA/IMG_0002.jpg
02-25 04:51:06.479  3239  3239 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12121 in setItem: wjc setItem E
02-25 04:51:06.489  3239  3239 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12091 in withStore: wjc withStore E
02-25 04:51:06.489  3239  3239 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12098 in withStore/<: wjc withStore callback
02-25 04:51:06.499  3239  3239 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12101 in withStore: wjc withStore X
02-25 04:51:06.499  3239  3239 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12128 in setItem: wjc setItem X
02-25 04:51:06.499  3239  3239 E GeckoConsole: Content JS LOG at app://camera.gaiamobile.org/js/main.js:12339 in exports.createDCFFilename/req.onerror: wjc onerror X

but after do storage.get, till req.onerror calls back , it take couple hundred ms,event is send from gecko.

Comment 37

4 years ago
(In reply to becker hsieh{:behsieh} from comment #36)
> req.onerror is callback when get ok filename
> inside req.onerror actually not cost too much time
> 02-25 04:51:06.479  3239  3239 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12329 in
> exports.createDCFFilename/req.onerror: wjc onerror E
> DCIM/100MZLLA/IMG_0002.jpg
> 02-25 04:51:06.479  3239  3239 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12121 in setItem: wjc setItem E
> 02-25 04:51:06.489  3239  3239 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12091 in withStore: wjc withStore E
> 02-25 04:51:06.489  3239  3239 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12098 in withStore/<: wjc withStore
> callback
> 02-25 04:51:06.499  3239  3239 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12101 in withStore: wjc withStore X
> 02-25 04:51:06.499  3239  3239 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12128 in setItem: wjc setItem X
> 02-25 04:51:06.499  3239  3239 E GeckoConsole: Content JS LOG at
> app://camera.gaiamobile.org/js/main.js:12339 in
> exports.createDCFFilename/req.onerror: wjc onerror X
> 
> but after do storage.get, till req.onerror calls back , it take couple
> hundred ms,event is send from gecko.

Hi becker:
   yes, what I mean is the time from doing storage.get to received req.onerror event is too long. this event is send from gecko. Doing the same process, flame is faster than 7715ea.

Comment 38

4 years ago
resoled on sprd camera driver
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: needinfo?(vchen)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.