Skip to main content
Inspiring
March 29, 2018
Answered

VertexBuffer3D uploadFromVector and uploadFromByteArray extremely slow Android and Context3D.clear() extremely slow on Samsung devices.

  • March 29, 2018
  • 3 replies
  • 554 views

Hi Guys,

For some reason VertexBuffer3D.uploadFromVector and VertexBuffer3D.uploadFromByteArray are extremely slow on Android and even more slow on Samsung devices with Exynos processor.

There is almost no difference in performance between VertexBuffer3D.uploadFromVector and VertexBuffer3D.uploadFromByteArray.

Samsung 6s Edge (Exynos Version):

https://ibb.co/kfbvjn

Huawei P10 Lite:

https://ibb.co/ntxqH7

Here is the Scout profile for Samsung:

https://goo.gl/Z1g3MN

And here it is for Huawei P10 Lite:

https://goo.gl/mY6TLP

On both devices I have played exact same particles.

As you can see Huawei P10 Lite has much better performance than Samsung s6 Edge and Samsung s9 Plus which is really strange. Could this be a bug in Adobe Air?

Performance on the Samsung 6s Edge are the same for Samsung Galaxy s9 Plus (Exynos version) which is even more strange.

Also there is a lot of Waiting for GPU as well and Context3D.clear() method is  also super slow on Samsung as well. Look at the beginning of the Scout profile you will see how Context3D.clear() is slow and I am not doing anything, not playing a level I just display background and some UI elements. Context3D.clear() is so much faster on Huawei P10 Lite for example you can see it in Scout profile. But everything is working fine on iOS and Desktop.

Is there anyone with a SnapDragon 835 or Snapdragon 845 phone that can help to test this?

I am using latest AIR SDK 29.0.0.112.

I am using latest Starling from master branch and Starudst Particle System from here:

https://bitbucket.org/hardcoremore/stardustparticlesystem

look at the refactor/upload-from-bytearray branch.

This topic has been closed for replies.
Correct answer chaky

IT IS FINALLY WORKING

I have increased vertex buffer count from 2 to 8 and now I can play 4 times more particles at 60FPS when using more buffers and switching to next buffer on every frame. That is 400% PERFORMANCE INCREASE. AWESOME

It looks like that on Android no matter how powerful the CPU or GPU their buffers are very slow to release so for Android it is good to have many vertex buffers it really increases the performance at least for particles.

Now I have Stardust Particle System that is working great on all platforms which is SUPERB

3 replies

chakyAuthorCorrect answer
Inspiring
March 30, 2018

IT IS FINALLY WORKING

I have increased vertex buffer count from 2 to 8 and now I can play 4 times more particles at 60FPS when using more buffers and switching to next buffer on every frame. That is 400% PERFORMANCE INCREASE. AWESOME

It looks like that on Android no matter how powerful the CPU or GPU their buffers are very slow to release so for Android it is good to have many vertex buffers it really increases the performance at least for particles.

Now I have Stardust Particle System that is working great on all platforms which is SUPERB

Inspiring
March 29, 2018

- How many draw calls are you getting with this?

- The byteArray version of that particle framework should be slower than the Vector version, that's expected.

- Are you clearing all buffers with clear?

- I have the feeling (I looked at their code briefly) that particle system is gonna be heavy on CPU. Run some tests without particles and see what overall perf you get.

Also if you already published apps for Ios and Android using Stage3D you should know by now CPUs and GPUs are not created equal, Ios are usually good/ok to very good (for mobile device) and Android are poor/very poor to good/ok. So as a app publisher you need to lower your expectations on Android or only support the best device. Ios usually can handle 40+ draw calls, Android is more in the 20 range to stay safe. How do you handle the difference in CPU power? Do you have a multiple resolution system?

chakyAuthor
Inspiring
March 29, 2018

Look at how big the difference is with iPhone 6s.

https://ibb.co/mveLZn

And here is the Scout profile:

https://goo.gl/wiDhj6

You can see that Stage3D took 0 milliseconds to render the exact same particles. On Samsung s6 Edge it took 10 000 milliseconds.

That much difference is insane.