Android Tutorial [B4X] BitmapCreator Performance

Discussion in 'Tutorials & Examples' started by Erel, May 31, 2018.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Edit: Tutorial about BitmapCreator performance:

    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.

    Attached Files:

    Last edited: Jun 7, 2018
    koaunglay, rscheel and MarcoRome like this.
  2. Star-Dust

    Star-Dust Expert Licensed User

    My test:
    B4A (Samsun S6) - 1,000 boxes
    B4A (Huawey MediaPad M3) - 1,800 boxes
    B4A (Honor 9) - 1,500 boxes

    The difference with Iphone seems excessive :confused:
    Johan Hormaza, Peter Simpson and Erel like this.
  3. rscheel

    rscheel Well-Known Member Licensed User

  4. sorex

    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 :)
  5. Erel

    Erel Administrator Staff Member Licensed User

  6. sorex

    sorex Expert Licensed User

    that's what I meant. it's excellent compared to what we had.
  7. Star-Dust

    Star-Dust Expert Licensed User

    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: Jul 17, 2018
    Peter Simpson likes this.
  8. Erel

    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.
  9. Filippo

    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.
  10. Erel

    Erel Administrator Staff Member Licensed User

    iPhone 8 was released three years after the iPhone 6. The performance difference can be large.
  11. Filippo

    Filippo Expert Licensed User

    Then the iPhone X will probably be faster than an iPhone 8+,
    but that's why I will not buy an iPhone-x. :p
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice