-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance on iPad 2 Sluggish when All Checkboxes Active #245
Comments
I tested http://www.colorado.edu/physics/phet/dev/html/energy-skate-park-basics/1.0.0-dev.53/energy-skate-park-basics_en.html on iPad3 and compared to the latest version http://www.colorado.edu/physics/phet/dev/html/energy-skate-park-basics/1.0.0-dev.62/energy-skate-park-basics_en.html (on the 1st screen with all checkboxes checked). dev.53 runs much faster on iPad3 (somewhere around a factor of 2 faster?). I suspect the speed dropped when we switched to a fixed timestep model in order to attain reproducible physics, and that the frame rates are actually very similar. I can look into this issue but we'll have to decide what an acceptable criteria is, and how long we can delay before publishing 1.0. I'll email @ariel-phet for feedback. |
Using ?profiler and comparing times taken of each checkbox independently on the 1st screen, I see: combining them in the sim: apparently there is some nonlinear interaction between the four items. |
By the way, WebGL would very likely solve these performance problems. We could publish now (or soon), then republish once we have a WebGL renderer. |
By the way, canvas renderer with no features enabled is about 10 frames per second (very sluggish!) |
@samreid, I think this is worth 1-2 hours of investigation to see if the severity of the issue can be reduced (perhaps also get @jonathanolson to help out). Please investigate and then lets talk when you have more information. The nonlinear interaction between the items makes me suspicious, but we definitely don't want to change the model/physics now to address this sort of issue since we seem to be in a fairly stable place. |
@jonathanolson and I worked on this for around 2 hours and discussed:
|
I pushed the last idea to the branch 'skipframes' |
By the way, @jonathanolson said this isn't the best sim for WebGL since many of the bounds/shape computations have to be done on the CPU anyways. |
It seems like using bar.computeShapeBounds = function() {return new Bounds2( 0, 0, 0, 0 )}; in BarChartNode and kineticEnergySlice.computeShapeBounds = function() {return new Bounds2( 0, 0, 0, 0 )};
potentialEnergySlice.computeShapeBounds = function() {return new Bounds2( 0, 0, 0, 0 )}; seems like it increases the average frame rate from 27fps to 31fps on iPad3. I'll keep this change if it doesn't look like those bounds are used. |
I tested and did not see any differences so I pushed the above change. |
@samreid just looked at latest push on ipad2 with @arouinfar said it looked better. Slowing down is still noticeable but less dramatic. Might be acceptable, we can discuss. |
Comparing to my earlier (high variance) numbers, it looks like rendering with all checkboxes on is costing about 34ms/frame instead of 36ms/frames, so it seems the above optimizations have sped things up by about 5% or so. |
I tried shrinking the bar chart + speedometer and moving them toward the middle to see if phetsims/scenery#270 was being triggered, and the performance did not seem affected. |
This problem will be solved for iOS8 devices, thanks to WebGL |
@jbphet reports the following for iPad2/iOS7 58fps average with all checkboxes off In my opinion, this is significantly better than before, and acceptable for publication. |
Test device: iPad2
Operating System: iOS 7.1.2
Browser: Safari
Problem description:
When turning on all four checkboxes, there is a very noticeable lag in the playback speed of the sim. This occurs when the skater is on a pre-built track or one made in the playground screen. The playback speed seems to reduce by about a factor of 2 if timing the skater with a stopwatch.
Steps to reproduce:
The sim speed will become noticeably sluggish.
Severity:
This is a very noticeable performance issue that should be addressed.
Screenshots:
I have a screen capture clip of this issue from an interview, but for IRB reasons I don't think I should post it publicly to GitHub. Email me if you would like to see the clip.
Troubleshooting information (do not edit):
Name: Energy Skate Park: Basics
URL: http://www.colorado.edu/physics/phet/dev/html/energy-skate-park-basics/1.0.0-dev.61/energy-skate-park-basics_en.html
Version: 1.0.0-dev.61
Features missing: fullscreen
User Agent: Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53
Language: en-us
Window: 1024x671
Pixel Ratio: 1/1
WebGL: disabled
The text was updated successfully, but these errors were encountered: