Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
setScale and setColorTrasform speed... (slowness?) — Gideros Forum

setScale and setColorTrasform speed... (slowness?)

GregBUGGregBUG Guru
edited February 2012 in General questions
it's normal that this 2 funcs are really slow on armv6 device (ex. iPod 2^gen) ?

i lost about 20-30% speed if i use it.

it's an opengl problem of olds ios devices ?

... mmmm ...

i feel depressed
:-S better go to sleep :!!
TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
www.tntengine.com

Comments

  • ar2rsawseenar2rsawseen Maintainer
    That's interesting
    I have only one app prototype that works slow on armv6, other games run fast enough.
    And I couldn't figure out why exactly this prototype. Maybe you just solved my problem. I'll check it out when I get back home. ;)
  • GregBUGGregBUG Guru
    edited March 2012
    ...really in game usage (i mean normal usage) they aren't so slow... (tested gidehelix on my ipod and work really smooth)

    in my particle engine i need to call it for every particle (ex 100 time a frame) and on my ipod if remove this 2 funcs my frame rate is about 20-30%... faster

    i think that i need (to speed up things) batch rendering... but is not possible in gideros at the moment right?



    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • atilimatilim Maintainer
    I see. setColorTrasform is in fact a fast operation. But setScale can be a little bit slower because calling it recalculates the sprite's internal transformation matrix. Let me look at it to improve its performance.
  • GregBUGGregBUG Guru
    edited March 2012
    @atilim
    after some "extensive stress" tests with particles seems that setRotation is also "slow" if not even slower than setScale... :-(( (on my iPod 2^gen is very noticeable)

    it's really that? :-S
    how can i optimize that?

    thanks
    gianluca.
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • atilimatilim Maintainer
    edited March 2012
    Hi gianluca,

    I've looked at the code but it seems it's optimized and compact already. I'll try to optimize more.

    Btw, are you using setScale and setRotation together? If so, I can combine the internal calculations and so that you can get a noticeable increase in speed.
  • Hi gianluca,
    Btw, are you using setScale and setRotation together? If so, I can combine the internal calculations and so that you can get a noticeable increase in speed.
    not always... it depends by the particle...
    let me check if a can combine together...
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • atilimatilim Maintainer
    No, no don't combine :) If you say not always, then you're doing it right.
  • GregBUGGregBUG Guru
    edited March 2012
    ok. ! thanks atilim to take time for my paranoid!!! :-S

    I would like to clarify one thing...
    (for those that read this tread and could think that some gideros graphics funtions are slow)

    when I say that the two functions are slow, I'm referring to old devices (ipod 2^n gen with armv6) because in reality (in normal use) they are really fast.

    my problem is that in my particles system I have to call whenever a particle moves! .. (if there are 200 particles on the screen i need to call for all the particles that need to rotate or zoom or alpha change)

    However, the real bottleneck (in my opinion) it is not the lua bytecode (which is indeed very fast) but I think it's the slowness of the graphics hardware of the old IOS device when using most of all rotations, alpha and size scales (i think that the hardware fill rate is slow).

    I tried to convert various "hard" parts of the engine in C but the difference is not much ... this to prove my theory (slow graphics hardware).

    I also tried on ipad 1st edition (which has a 1GHz processor) and is much slower than my samsung galaxy s (which also has a 1Ghz processor,but moves very well 400 particles on the screen without problems ...)

    so... if you (@atilim) can optimize more the engine i really happy but i think that you had already done the best.

    i my case i think that i passed the hardware limit of my poor ipod... :)

    anyone has seen on an ipod 2 ^nd gen more than 80 particles move smoothly (with scale, alpha and rotations) ?

    thanks.
    what do you think?

    Likes: atilim

    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
    +1 -1 (+1 / -0 )Share on Facebook
  • Mmmh, did you define your Lua math... calls as local?

    Did you switch "Thumb" mode off when you compiled the plugin for the IPod 2nd gen?
  • yes all math function declared as local

    ex.
    local qSin = math.sin
    local qCos = math.cos
    local qRandom = math.random
    local qRad = math.rad
    local qDeg = math.deg

    > "Thumb" mode

    no... what is this ? :)
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
  • atilimatilim Maintainer
    edited March 2012
    yes all math function declared as local

    ex.
    local qSin = math.sin
    local qCos = math.cos
    local qRandom = math.random
    local qRad = math.rad
    local qDeg = math.deg
    Loves: atilim :)


    btw, all of our Xcode projects have Thumb mode "off".
  • @mikeHart
    Intresting article!!! :-B
    But not change my Doubts. :(
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
    www.tntengine.com
Sign In or Register to comment.