Application performance during a video call

During a video call i see that the application is too slow!
For example: in my application, clicking on a button, the application shows a modal menu that the user can use to select the camera or make some others operations.
If the user clicks on this button before making a video call, the application shows the menu instantly; in other case, clicking the button during a video call, the menu is displayed after a long time.
Another example is the call duration timer: during a video call, for approximately 30 seconds, the application shows the correct elapsed time; after 30 seconds the counter seems to freeze for 5 or 6 seconds, after that is updated.
It seems that during the video call there is an expansive heavy native process that blocks the thread.

Any suggestion?

Do you debugging during the test?

Debugging during the test the situation is worse than the release version: the device it seems that does not react to user interaction.
Anyway i don’t see any errors in the log.
Here there are logs before entering the video chat room (so before the webrtc connection is established):
06-11 09:20:41.575 8532-8627/com.rctwebrtcdemoecl I/org.webrtc.Logging: CameraStatistics: Camera fps: 17.
06-11 09:20:43.575 8532-8627/com.rctwebrtcdemoecl I/org.webrtc.Logging: CameraStatistics: Camera fps: 17.
06-11 09:20:44.075 8532-8657/com.rctwebrtcdemoecl W/ResourceType: No known package when getting name for resource number 0xffffffff
06-11 09:20:44.075 8532-8657/com.rctwebrtcdemoecl I/org.webrtc.Logging: SurfaceViewRenderer: Frames received: 301. Dropped: 0. Rendered: 300
06-11 09:20:44.075 8532-8657/com.rctwebrtcdemoecl W/ResourceType: No known package when getting name for resource number 0xffffffff
06-11 09:20:44.075 8532-8657/com.rctwebrtcdemoecl I/org.webrtc.Logging: SurfaceViewRenderer: Duration: 17968 ms. FPS: 16.695751430881202
06-11 09:20:44.075 8532-8657/com.rctwebrtcdemoecl W/ResourceType: No known package when getting name for resource number 0xffffffff
06-11 09:20:44.075 8532-8657/com.rctwebrtcdemoecl I/org.webrtc.Logging: SurfaceViewRenderer: Average render time: 7097 us.
06-11 09:20:45.575 8532-8627/com.rctwebrtcdemoecl I/org.webrtc.Logging: CameraStatistics: Camera fps: 17.

And this is the log i see dunring the call:
06-11 09:23:35.550 8532-10205/com.rctwebrtcdemoecl I/org.webrtc.Logging: CameraStatistics: Camera fps: 17.
06-11 09:23:36.155 8532-10314/com.rctwebrtcdemoecl W/ResourceType: No known package when getting name for resource number 0xffffffff
06-11 09:23:36.155 8532-10314/com.rctwebrtcdemoecl I/org.webrtc.Logging: SurfaceViewRenderer: Frames received: 302. Dropped: 0. Rendered: 300
06-11 09:23:36.155 8532-10314/com.rctwebrtcdemoecl W/ResourceType: No known package when getting name for resource number 0xffffffff
06-11 09:23:36.155 8532-10314/com.rctwebrtcdemoecl I/org.webrtc.Logging: SurfaceViewRenderer: Duration: 19967 ms. FPS: 15.024552146521957
06-11 09:23:36.155 8532-10314/com.rctwebrtcdemoecl W/ResourceType: No known package when getting name for resource number 0xffffffff
06-11 09:23:36.155 8532-10314/com.rctwebrtcdemoecl I/org.webrtc.Logging: SurfaceViewRenderer: Average render time: 3142 us.
06-11 09:23:37.550 8532-10205/com.rctwebrtcdemoecl I/org.webrtc.Logging: CameraStatistics: Camera fps: 17.
06-11 09:23:39.550 8532-10205/com.rctwebrtcdemoecl I/org.webrtc.Logging: CameraStatistics: Camera fps: 17.
06-11 09:23:41.550 8532-10205/com.rctwebrtcdemoecl I/org.webrtc.Logging: CameraStatistics: Camera fps: 17.
06-11 09:23:42.930 8532-10272/com.rctwebrtcdemoecl I/org.webrtc.Logging: NetworkMonitorAutoDetect: capabilities changed: [ Transports: WIFI Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps SignalStrength: -63]
If you need i can add more logs, or i can try to debug in some point!
Let me know!
Thank you!

I can’t find anything from logs. I know it might not be the best practice but have you test it on another phone? (physical device)

Furthermore I would try to simplify the app to see if the problem persist. For example try to run the same code with just the camera implementation in a single App.js.

At least this is what I would do, because I was in the same situation previously (with another problem), and when I tried to debug it in smaller chunks I found the problem.

Maybe saghul can give you a more techincal answer for your problem.

Thank you for your answer!
Yes, I have tried also with other devices, and the problem persists (using more powerful devices the problem is there even if lower than other devices).
Our application it’s a complex one but the there is the same problem on a smaller test app (https://github.com/oney/RCTWebRTCDemo); I tried this application to avoid that application issues could affect the behavior, and then try to identify if the problem could be traced back to the webrtc part only. Starting from this application i added a button that shows the modal and the timer (because without changes I could not verify if the problem was there).

Are you seeing this in a debug build or a release build?

Uhm…
I don’t know how to take logs for a release build (how to?).
It’s the log for the debug build; if you can help me to take logs for release mode I’ll paste here!

I mean, do you observe the same behavior (sluigh UI) when in release mode?

Oh yes! In release mode behaviour is a little bit better but the problem persist!

I see. It’s virtually impossible to tell you right off the bat what the cause could be. Calling getStats too often, for example, is very taxing.

I’d suggest you try to make the smallest possible test case which exhibits the issue and start removing stuff until you see an improvement.