Android Tutorial [B4X] BitmapCreator Performance

Erel

Administrator
Staff member
Licensed User
Edit: Tutorial about BitmapCreator performance: https://www.b4x.com/android/forum/threads/b4x-bitmapcreator-maximizing-performance-with-bc.93907/


I made some tests to better understand the performance of BitmapCreator in the different platforms.

The test starts by creating many boxes with random gradient colors and then it moves all of them each iteration.




I looked for the number of boxes where the time it takes to draw all boxes over the main BitmapCreator was less than 15ms.

The results are quite interesting and of course that they depend on the actual hardware used:

B4J - more than 20,000 boxes
B4A (Nexus 5X) - 1,000 boxes
B4i (iPhone 8+) - 20,000 boxes

B4i result is a bit surprising. It is related to the performance improvements done in B4i v5.0.

Note that the boxes are drawn with SkipBlending = True. It will be much slower with blending (blending means that transparent parts and semi-transparent parts of the drawn image are blended with the current pixel color).

Overall the results are quite good.
 

Attachments

Last edited:

sorex

Expert
Licensed User
B4J could use this. I ran that B4J gameview asteroids example a few weeks ago and it ate all my cpu power just to display a few rotating asteroids and a ship :)
 

Star-Dust

Expert
Licensed User
The results are quite interesting and of course that they depend on the actual hardware used:

B4J - more than 20,000 boxes
B4A (Nexus 5X) - 1,000 boxes
B4i (iPhone 8+) - 20,000 boxes

B4i result is a bit surprising. It is related to the performance improvements done in B4i v5.0.

Note that the boxes are drawn with SkipBlending = True. It will be much slower with blending (blending means that transparent parts and semi-transparent parts of the drawn image are blended with the current pixel color).
In my 3D Library the BitmapCreator works well on the B4J, very well on B4A but bad on B4i.
Also I was surprised, I expected better ios.

A heavy 3D object, which b4A runs with 450ms, Iphone also employs 2000ms :confused::confused:
 
Last edited:

Erel

Administrator
Staff member
Licensed User
Make sure to test it with B4i v5+.

You should start a new thread and post the exact details. I tested the project you sent me and was able to make it run 10 times faster on B4i. I'm pretty sure that it can be further optimized.
 

Filippo

Expert
Licensed User
May be between iPhone 8+ and iPhone 6+ such a big performance difference?
Test in Release-Mode with iPhone 6+, B4i v5.0 and BitmapCreator v3.60.
BitmapCreator_Performance_iPhone_6+_01.jpg
 

Erel

Administrator
Staff member
Licensed User
iPhone 8 was released three years after the iPhone 6. The performance difference can be large.
 
Top