Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

(Android) Unity got Poor CPU Performance compared with Native apk

wangxiaoganganwangxiaogangan Posts: 21
Brain Burst
Hello everyone, my team have been contributing to develop " view dependent media player ", which using a single thread decode 2048 * 1536 with android-media-codec (we can call it BASE TEX) and four thread decode 512 * 256 * 24 split blocks for viewer directly look at with ffmpeg (we can call it HD TEX), very similar with VR_5K_PLAYER.

The above main framework make the cpu usage more heavy compare with gpu. Cpu need decode 2048 *1536 totally and upload YUV from memory to video memory every frame, while gpu only decode 2048 *1536. After a few test with Samsung S8 & Quest, i found that, s8 & Quest got different performance which s8 got a high fps because of Quest has less cpu avaliability compare with S8.

( PS: S8 & Quest all equiped with snapdragon 835. as far as i know, the 835 chip contain 8 core,  4 core of all 8 core are big core responsible for heavy work )

To confirm my point of view , i made a test proj using unity &  the latest gear sdk, add heavy cpu work for some thread

public class NewBehaviourScript : MonoBehaviour {


the enclosed python file use "adb shell cat /proc/stat" to calculate 8 core usage. 

 

the above result is S8, the last four core are big core usage, while 3 big core execute full load. 

 


the above result is Quest, the last four core are big core usage, while 2 big core execute full load.

my team also made a native android project which using gradle & android studio & without gear, loading my dynamic library through jni & execute view dependent media player. the S8 cpu usage is



the below result is executed with S8 using unity & gear & same dynamic library,   



the two test show that native apk get a better & average cpu usage while heavy cpu work executing, compared with unity & gear apk.

My question is, 
  1. Is there a way for unity & gear apk to control device cpu availability rate ?
  2. why native apk performance diff with unity & gear apk?
  3. why Quest got less core to execute cpu work compared with S8?

Sign In or Register to comment.