Skip to content
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

[iPad2] performance drop with play button #26

Open
brroberts1231 opened this issue Jun 29, 2016 · 35 comments
Open

[iPad2] performance drop with play button #26

brroberts1231 opened this issue Jun 29, 2016 · 35 comments

Comments

@brroberts1231
Copy link

brroberts1231 commented Jun 29, 2016

For phetsims/tasks#630
Test device: Tycho

Operating System: iOS 9.3.3

Browser: Safari

Problem description: Sim slows down substantially for a short time when you press the play button. This can be seen most easily by repeatedly pressing the play button to drop individual balls quickly.

Screenshots:
https://drive.google.com/file/d/0B9-NgawDrEu3STBnSTJ1T0ZURGs/view?usp=sharing

Troubleshooting information (do not edit):
Name: ‪Plinko Probability‬
URL: http://www.colorado.edu/physics/phet/dev/html/plinko-probability/1.0.0-dev.5/plinko-probability_en.html
Version: 1.0.0-dev.5 2016-06-27 15:36:39 UTC
Features missing: fullscreen
User Agent: Mozilla/5.0 (iPad; CPU OS 9_3_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13G21 Safari/601.1
Language: en-us
Window: 1024x671
Pixel Ratio: 1/1
WebGL: WebGL 1.0 (OpenGL ES 2.0 IMGSGX543-124.1)
GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.00)
Vendor: WebKit (WebKit WebGL)
Vertex: attribs: 16 varying: 8 uniform: 128
Texture: size: 4096 imageUnits: 8 (vertex: 8, combined: 8)
Max viewport: 4096x4096
OES_texture_float: true
Dependencies JSON: {"assert":{"sha":"7d27130a","branch":"master"},"axon":{"sha":"b71cc337","branch":"master"},"babel":{"sha":"0ce3b9c8","branch":"master"},"brand":{"sha":"f0b1f7da","branch":"master"},"chipper":{"sha":"e044eccd","branch":"master"},"dot":{"sha":"c9c05a5a","branch":"master"},"joist":{"sha":"fa5db70c","branch":"master"},"kite":{"sha":"dce9765e","branch":"master"},"phet-core":{"sha":"c48bf320","branch":"master"},"phetcommon":{"sha":"35ef94ad","branch":"master"},"plinko-probability":{"sha":"af3b08d0","branch":"master"},"scenery":{"sha":"4476eb95","branch":"master"},"scenery-phet":{"sha":"52b783d9","branch":"master"},"sherpa":{"sha":"77506dc3","branch":"master"},"sun":{"sha":"0d7e743b","branch":"master"},"tandem":{"sha":"b3c68afa","branch":"master"}}

@phet-steele
Copy link

No change in 1.0.0-dev.6

@veillette
Copy link
Contributor

Using the Ipad2, and unhooking the listener attached to the PlayButton, then the sim frame rate could go down as low as 12 fps while tapping the PlayButton.

This happens in requirejs and build mode.

I wonder if it is related to the gradients in the Play Button.

@veillette
Copy link
Contributor

Using a flatAppereanceStrategy, then the lowest number of frames I could get was 40 fps (with no listener).

@veillette
Copy link
Contributor

And hooking back the listener but with the flatAppereanceStrategy the lowest fps I could get was 30fps.

@pixelzoom
Copy link
Contributor

@veillette I'm surprised that changing the appearance of the play button has any affect on performance. Any chance that you have a Canvas that's overlapping the play button, and causing it to be redrawn on every frame?

@veillette
Copy link
Contributor

There are two canvas nodes in the simulation. One for the pegs and one for the rendering of the balls. The peg canvas is limited to the galton board. It is a rectangle that just encompasses the triangular galton board.

The ballsLayerNode canvas is redrawn at every frame but it does not overlap with the play button. The ballsLayerNode canvas bounds are given by the union of the galtonBoard and the histogramBounds.

The performance is something that is symptomatic of the iPad and the Sun Buttons. This may have slipped under the radar as no other PhET simulations expect someone to be tapping a button. I logged an issue in sun (phetsims/sun#244).

@pixelzoom
Copy link
Contributor

pixelzoom commented Aug 29, 2016

Ideally, we'd like to change the play button back to 3dAppearanceStrategy. @ariel-phet noted the (unexpected) change from 3D to flat when I published 1.0.0-dev.7.

@ariel-phet
Copy link

Actually, I knew this was a possibility given the open issues, however we should get the opinion of @amanda-phet

I would be OK with the flat look so long as it is still easy to find. The 3d button does "pop" a bit more, but the sim is fairly straightforward.

@pixelzoom pixelzoom changed the title iPad 2 performance drop with play button iPad2 performance drop with play button Aug 29, 2016
@amanda-phet
Copy link
Contributor

The flat design is fine.

@pixelzoom
Copy link
Contributor

pixelzoom commented Aug 30, 2016

#62 may be partially responsible for this. The sim is continuously calling paintCanvas, even when nothing on the screen is changing. That may not leave enough time to mutate and repaint the button fill for the 3D look.

@ariel-phet
Copy link

If we do go for the "flat" look, lets make sure to center the black triangle of the play button in the circle (it is a little off to the left currently)

@pixelzoom
Copy link
Contributor

lets make sure to center the black triangle of the play button in the circle

I'm afraid that's not currently possible. See phetsims/sun#236, which we agreed to address on 4/22/16, but has not made any progress.

@veillette
Copy link
Contributor

I think it may be related to a commit I did, that should be reverted.
I was trying to minimizes the number of scenery nodes, I did not realized that it changed the centering of the play button.

9f3c042

@pixelzoom
Copy link
Contributor

The centering problem is a general problem with sun buttons, where the content on flat buttons is not centered properly. See phetsims/sun#236.

@amanda-phet
Copy link
Contributor

@ariel-phet I thought it looked off-center as well but when I played with this in illustrator I am more convinced that it is an optical illusion.

screen shot 2016-08-30 at 10 27 39 am

@ariel-phet
Copy link

The flat button....

I might have some ever so slight concern if this sim had many controls, but with so few controls it is just not really an issue.

It would be good to understand this issue at some point ideally, but since it seems pathologically tied to this sim, I am also not too concerned.

So - lets do two things:

  1. Go with the flat button here
  2. Make a Sun issue and mark it for developer meeting - just so we brain storm as a group and I might have you spend an hour at some point in the future investigating if anyone comes up with a lead worth following.

@ariel-phet
Copy link

unassinging @amanda-phet since she already gave the green light to the flat button in #26 (comment)

@pixelzoom
Copy link
Contributor

@ariel-phet It might be worth having @jonathanolson spend 15 minutes digging around in the DOM to see if there's anything obvious. The DOM structure is still a mystery to me, so I'm unlikely to see the problem even if I'm looking directly at it.

@pixelzoom
Copy link
Contributor

pixelzoom commented Sep 9, 2016

@ariel-phet said:

Go with the flat button here

OK. Not a blocking issue for publication.

Make a Sun issue and mark it for developer meeting

Since this problem is "pathologically tied to this sim", I don't think a sun issue is appropriate. I'm going to leave this issue open, mark it for developer meeting, and we can brainstorm here.

@ariel-phet
Copy link

@pixelzoom - I am curious about one WAG for an experiment. What if the play button were taken out of the control panel and put in the lower left such as in Rutherford (most of the time we have not had play buttons in control panels).

Note - I am NOT suggesting we change the design. But if that were an easy experiment to perform, might be worth a try. Or better yet, put a flat button in the control panel and have a 3d button in the lower left (still a play button) so you could try the performance experiment in the same sim.

@pixelzoom
Copy link
Contributor

@ariel-phet suggested:

What if the play button were taken out of the control panel and put in the lower left ....

Yes, worth a try.

@pixelzoom
Copy link
Contributor

@ariel-phet I tried what you suggested in #26 (comment). See http://www.colorado.edu/physics/phet/dev/html/plinko-probability/1.0.0-dev.15/plinko-probability_en.html.

In addition to the flat Play button in the upper-right panel of the Intro screen, this version has a 3D Play button in the lower-left corner. Pressing either Play button performs the same action.

On iPad2 + iOS 9.3.5:
• animation slows down slightly when repeatedly pressing the flat Play button
• animation slows down dramatically when repeatedly pressing the 3D Play button

I also tried putting the 3D Play button in the upper-left, with identical results.

@pixelzoom
Copy link
Contributor

@pixelzoom
Copy link
Contributor

pixelzoom commented Sep 13, 2016

Things we haven't done yet:

(1) Brainstorm as a group, scheduled for Thu Sep 15. (#26 (comment))
(2) Ask @jonathanolson to have a look. This would likely be more efficient than (1). (#26 (comment))

@ariel-phet How do you want to proceed? This is the only open issue blocking dev testing. Do you want to do either of the above before dev testing begins?

@ariel-phet
Copy link

@pixelzoom - lets proceed with dev testing and a flat button if this is the only remaining issue.

I will ask @jonathanolson to take a look, but he can do that regardless of dev testing. As we have noted this issue appears to be pathological to this sim, you have put quite a bit of intellectual effort into fixing it, and the flat bottom is a completely reasonable solutoin.

@ariel-phet ariel-phet removed their assignment Sep 13, 2016
@jonathanolson jonathanolson self-assigned this Sep 13, 2016
@pixelzoom
Copy link
Contributor

@jonathanolson If you have time to take a look... You can switch between flat and 3D buttons using a query parameter, as described in #26 (comment). To reproduce the problem, run the sim on iPad2, go to the "Intro" screen, press the Play button repeatedly.

@pixelzoom
Copy link
Contributor

Not a prerequisite for 1.0.0.

@jonathanolson
Copy link
Contributor

Since this is deferred, dropping priority. Probably related to gradients being loaded/unloaded if I need to investigate.

@jonathanolson jonathanolson removed their assignment Oct 6, 2016
@pixelzoom pixelzoom changed the title iPad2 performance drop with play button [iPad2] performance drop with play button Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants