phetsims / vegas

Reusable game components for PhET simulations.
MIT License
1 stars 4 forks source link

de-jerkify reward node #50

Closed jbphet closed 7 years ago

jbphet commented 8 years ago

The reward node doesn't run very smoothly sometimes - items will fall for a bit, then pause, then resume. This was logged as in issue against Build an Atom, but is really an issue with this piece of common code, see https://github.com/phetsims/build-an-atom/issues/66. On my development machine, the problem is particularly noticeable on Firefox.

jbphet commented 8 years ago

Assigning to @ariel-phet to prioritize and assign.

ariel-phet commented 8 years ago

@andrewadare I am going to assign this to you for now. No action is necessarily currently, however, once you have paired with @jonathanolson on Gravity and Orbits lets revisit this issue, it might be a nice one for you to do some more learning about optimizing performance and working with common code.

mattpen commented 7 years ago

@jonathanolson will work on this as part of make-a-ten

jonathanolson commented 7 years ago

I'm not able to reproduce this jerkiness on Win10/Firefox at home. @ariel-phet, the only place I've seen it slow is on @jbphet's desktop with Firefox. Should we look into testing other devices, or should I pair with @jbphet when he has time?

ariel-phet commented 7 years ago

@jonathanolson can you make a new dev version and reassign me once it is published? I feel like I may have seen this on iPad2

jonathanolson commented 7 years ago

http://www.colorado.edu/physics/phet/dev/html/make-a-ten/1.0.0-dev.12/make-a-ten_en.html, "solve" the first level 10 times.

ariel-phet commented 7 years ago

@jonathanolson this can be pretty easily reproduced on iPad2 iOS 9.3.5. Basically looks like some GC (though it may be something different).

On Thursday perhaps borrow an iPad2 to take a look? I think if the reward node rendered less objects or moved a bit more slowly it would be fine (if those tweaks help).

Also, we have never received a complaint about this behavior, it is definitely more in the "polish" category, so it is only worthy of a short investigation for low-hanging fruit optimizations if they exist.

jonathanolson commented 7 years ago

The Canvas code is quite optimized here, I really don't see low-hanging fruit.

It is possible that implementing it as a WebGLNode or using images with the WebGL renderer could have a performance improvement.

@ariel-phet, thoughts on priority for that?

ariel-phet commented 7 years ago

@jonathanolson considering that on most platforms performance is good, I am just going to close this issue, it is not worth the time investment to experiment with WebGLNode or such.