Jump to content
GreenSock

summon

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by summon

  1. I don't think there's much we can do about the "touchcancel" thing (sounds like an odd iOS quirk) but would you mind trying the attached update of Draggable to see if it performs better for you? Basically, it avoids adding the "tick" listener until the first drag, and then 15 seconds after inactivity, it'll remove it as well. Usually the "tick" handler really isn't much of a CPU hog at all, but maybe on such old devices (and in older operating systems) it's more noticeable. 

     

    Hi GreenSock,

     

    thanks a lot for the support! I used that and performance is somewhat better now.

     

    Thanks again. Keep up the good work!

  2. Wow. Never heard of anything like that before. Ha. We use the industry standard UglifyJS which seemed to work around some issues with Google's own Closure Compiler. Would you mind testing the latest 1.11.0 files that we just posted? http://www.greensock.com/?download=GSAP-JS. I'm curious if you see the same issue with that finalized minified file. 

     

    I recall my previous statement, there is no diferrence between the minified and non minified versions of draggable.  :oops: Sorry about the frustration.

     

    Well I used the latest version you proposed and indeed the two methods you mentioned are the overhead and more specific:

    1. When both tick listener and touchcancel are commented CPU is back to normal 11-14%
    2. When only tick listener is on then CPU is at 22-25%
    3. When only touchcancel listener is on then CPU is at 17-20%
    4. When both are on CPU is at 30-32%

    These are the clues, double checked everything

  3. I can't see anything in the code that could possibly cause a big CPU load on touch devices just by loading the Draggable file - do you? 

     

    You could try removing the line toward the very bottom of Draggable that adds a "touchcancel" listener, just to see if for some strange reason simply listening for touchcancel on an iPhone 3GS is CPU-intensive (I can't imagine why it would be). 

     

    Lastly, you could try removing the "tick" listener right above that line too, just to see if that's the culprit, but again, that really shouldn't be a big drain. 

     

    Believe it or not the minified version is causing the CPU load!!!

     

    When I replaced the minified version of Draggable with the non minified in order to do the tests you proposed the load went back to normal.

     

    :shock:  :shock:  :shock:  :shock:  :-o  :-o  :shock:  8-)

  4. Hi everyone,

     

    I am using 

    TweenLite.ticker.addEventListener("tick", updateGameState);
    

    to update the state of my game. The updateGameState function is called as it should be but when I leave the game screen and remove the listener using

    TweenLite.ticker.removeEventListener("tick", updateGameState); 

    the ticker continues to tick and the time / frames continue to count. When I re-register my updateGameState function to the ticker then the current time is not zero. I would like to stop or pause the ticker while I leave / enter the game screen, in order to keep track of the game state.

     

    Is there a way to do this? Or am I to the wrong path?

     

  5. Thank you very much for your replies! I made some testing before answering.

     

    Here are my findings.

     

    Tests setup:

    1. iPhone 3GS - iOS 6.1.3
    2. iPad 2 - iOS 7.0.3
    3. Instrument tools from Apple using Time Profiler
    4. Latest version of gsap js library from here
    5. In every test I moved one finger and/or tapped many times on the screen of the device. In general I abused the screen with my finger.

    Test 1:

    1. Create an app that shows a blank html page.
    2. Code for the test: 
      <HTML>
          <HEAD>
              <TITLE>Your Title Here</TITLE>
          </HEAD>
          <BODY BGCOLOR="000000">
          </BODY>
      </HTML>
      
    3. CPU Usage:
      1. 10-14% on iPhone 3GS
      2. 2-3% on iPad 2

    Test 2:

    1. Create an app that shows a blank html page that has jQuery added.
    2. Code for the test: 
      <HTML>
          <HEAD>
              <TITLE>Your Title Here</TITLE>
      	    <script type="text/javascript" src="js/jquery/jquery-2.0.0.min.js"></script>
          </HEAD>
          <BODY BGCOLOR="000000">
          </BODY>
      </HTML>
      
    3. CPU Usage:
      1. 11-14% on iPhone 3GS
      2. 2-4% on iPad 2

    Test 3: 

    1. Create an app that shows a blank html page that has jQuery and TweenMax added
    2. Code: 
      <HTML>
          <HEAD>
              <TITLE>Your Title Here</TITLE>
      		<script type="text/javascript" src="js/jquery/jquery-2.0.0.min.js"></script>
      		<script type="text/javascript" src="js/greensock/TweenMax.min.js"></script>
          </HEAD>
          <BODY BGCOLOR="000000">
          </BODY>
      </HTML>
      
    3. CPU Usage:
      1. 11-14% on iPhone 3GS
      2. 2-4% on iPad 2

    Test 4: 

    1. Create an app that shows a blank html page that has jQuery, TweenMax and Draggable added
    2. Code: 
      <HTML>
          <HEAD>
              <TITLE>Your Title Here</TITLE>
      		<script type="text/javascript" src="js/jquery/jquery-2.0.0.min.js"></script>
      		<script type="text/javascript" src="js/greensock/utils/Draggable.min.js"></script>
      		<script type="text/javascript" src="js/greensock/TweenMax.min.js"></script>
          </HEAD>
          <BODY BGCOLOR="000000">
          </BODY>
      </HTML>
      
    3. CPU Usage:
      1. 28-35% on iPhone 3GS
      2. 6-9% on iPad 2

    The html page does not even contain a draggable element. Only a reference to the library. The overhead is directly related to touch handling.

     

    Can you take a look on this?

     

    Thanks for your time!

  6. Hi

     

    There are two possibilities.

     

    First you could use force3D: true in the tween vars n order to get the GPU in the mix, thus limiting the CPU cycles involved.

     

    Another would be to create a very simple test in order to see if this could be a browser issue, the main idea with this reduced sample is to narrow down the possible causes as much as possible.

     

    Also try tje engine's latest 1.11 preview because it has some major improvements on the Draggable tool.

     

    Best

    Rodrigo

     

    Hi Rodrigo,

     

    thx for your reply. I made a test that has a single draggable element and there is indeed the same issue. Also, I already did the z : 0.1 trick, on the draggable element, so I suppose that force3D will not improve the performance.

     

    Do you have any other suggestions and moreover where can I find the latest version of GSAP or the version you mentioned??

     

    Thanks in advance

  7. Hi everyone,

     

    its been a few days since I found out and started using gsap js and must admit its an awesome framework.

     

    I make native games for iOS and now I evaluate gsap for html 5 cross platform 2d game development.

     

    I have a strange performance issue regarding the Draggable utility on iOS devices (maybe on other platforms too but I have not tested any other device).

     

    When the user moves the draggable element around with his finger I observe high CPU usage (55-65% on an iPhone 3GS) while when the user is not interracting with the element the CPU usage is 25-35%. I downloaded an updated version of Draggable from here but there was no difference.

     

    I am at your disposal for further info and testing!

×