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

The sim really stutters when the mouse changes from hand to arrow and back #208

Closed
samreid opened this issue Aug 29, 2014 · 28 comments
Closed
Assignees
Milestone

Comments

@samreid
Copy link
Member

samreid commented Aug 29, 2014

Win8/Chrome, The sim really stutters when the mouse changes from hand to and back

@samreid samreid self-assigned this Aug 29, 2014
@samreid
Copy link
Member Author

samreid commented Sep 2, 2014

This was also observed by an independent group in Fluid Pressure and Flow, and we have promoted it to a general scenery issue: phetsims/scenery#275

@samreid samreid changed the title The sim really stutters when the mouse changes from hand to and back The sim really stutters when the mouse changes from hand to arrow and back Sep 4, 2014
@samreid
Copy link
Member Author

samreid commented Sep 5, 2014

Same issue on OSX10.9.2/Chrome37. Pretty severe.

@ariel-phet
Copy link

This seems like a high priority to fix as a scenery bug

@samreid
Copy link
Member Author

samreid commented Sep 8, 2014

@jonathanolson can you help look into this?

@samreid samreid assigned jonathanolson and unassigned samreid Sep 8, 2014
@jonathanolson
Copy link
Contributor

Didn't find any references to this in the Chromium bug tracker. Will try investigating workarounds.

@jonathanolson
Copy link
Contributor

Please see comments in phetsims/scenery#275, it's somewhat written with ESPB in mind (large number of nodes).

@samreid
Copy link
Member Author

samreid commented Sep 12, 2014

@jonathanolson said:

I'd highly recommend combining many line/path elements into a single path (see GridNode, GaugeNode), and minimizing the number of nodes (it's reflowing the invisible ones also). I see ToggleButtonDeprecated with 4 copies of things. The Scene when loaded in the 1st tab has ~1320 nodes in the tree (including all screens), so I'd recommend testing with the add/remove child for screens instead of visibility toggles to see if that helps.

I tried commenting out the ticks in GaugeNode and GridNode, and getting rid of the ToggleButtonNode, but the reflow time is still very long in Win8/Chrome (difficult to tell if it helped much just by looking).

@samreid
Copy link
Member Author

samreid commented Sep 12, 2014

Additionally setting screenDisplayStrategy: 'setChildren' seems to have significantly reduced the problem. Switching screens doesn't seem like it takes so long that it would cause problems. Maybe this is a good tradeoff.

@samreid
Copy link
Member Author

samreid commented Sep 12, 2014

Here is the current size of the scene graph:

1305 lines in the original version.
580 lines when using 'setChildren' instead of 'setVisible'
546 lines when using 'setChildren' and no gridnode
538 lines when using 'setChildren' and no gaugenode ticks
532 lines when using 'setChildren' and no ToggleNodeDeprecated.
456 lines when using all changes above

@samreid
Copy link
Member Author

samreid commented Sep 12, 2014

Converting AttachDetachToggleButtons to use RadioButtons leaves the node count unchanged at 344.

@samreid
Copy link
Member Author

samreid commented Sep 12, 2014

I switched from DeprecatedToggleButtons in the SceneSelectionPanel in #243 and now the node count is down around 578

@samreid
Copy link
Member Author

samreid commented Sep 12, 2014

Hmmmmmm... If I put ?standalone, then the node count drops to 372. Are we really using 206 nodes in the home screen + navbar?

EDIT: Home screen => home screen + navbar.

@samreid
Copy link
Member Author

samreid commented Sep 12, 2014

After the above commit, I am down to 542 nodes.

@samreid
Copy link
Member Author

samreid commented Sep 13, 2014

After consolidating GridNod lines above, I am down to 510 nodes, and the delay on Win8/Chrome is looking significantly better.

@samreid
Copy link
Member Author

samreid commented Sep 13, 2014

By the way, @jonathanolson said joist/scenery02has consolidated many joist nodes, which may reduce the number further (nearly half of the nodes are now joist).

@samreid
Copy link
Member Author

samreid commented Sep 13, 2014

Checking with ?standalone reveals almost no delay, so perhaps joist is the next place to optimize. I also saw many duplicated nodes with the new RadioButtonGroup, perhaps that is another place we can optimize.

@samreid
Copy link
Member Author

samreid commented Sep 15, 2014

I tried getting @jonathanolson's changes to NavigationBarScreenButton from joist/ohtwo and this reduced the number of nodes from 509 to 344. In my opinion, that is very significant. I'll look into merging that commit into master.

@samreid
Copy link
Member Author

samreid commented Sep 15, 2014

Well, we have gone from 1305 lines and a huge delay to 344 lines and a very short delay, so I think this issue is ready to be closed. We will need to test the new navbar buttons, switching screens, the grid and the speedometer to make sure no new problems were introduced in these changes.

@samreid
Copy link
Member Author

samreid commented Sep 24, 2014

After rendering some things in WebGL, we are down to 303 nodes. However, this latter reduction did not seem to reduce the "hitch" time significantly.

@samreid
Copy link
Member Author

samreid commented Sep 24, 2014

In my opinion, this problem is sufficiently reduced for this sim, and acceptable for publication. Closing.

@samreid samreid closed this as completed Sep 24, 2014
@samreid
Copy link
Member Author

samreid commented Oct 8, 2014

This got worse in Chrome 38, see phetsims/scenery#275 and noted in #294

@bryo5363
Copy link

bryo5363 commented Oct 9, 2014

I did not notice any changes in the simulation performance in Safari 9537.85.10.17.1

@samreid
Copy link
Member Author

samreid commented Oct 9, 2014

This problem seems chrome specific.

@samreid
Copy link
Member Author

samreid commented Oct 24, 2014

Not quite as bad on OSX 10.10 + Chrome Version 38.0.2125.104 on my MacBook Air (11-inch, Mid 2012)

@samreid
Copy link
Member Author

samreid commented Oct 24, 2014

Also not much we can do about this until we are focusing more on WebGL.

@ariel-phet
Copy link

Agreed, wait until we have more webgl support.

@samreid samreid added this to the 1.1+ milestone Oct 24, 2014
@jessegreenberg
Copy link
Contributor

I am not seeing this happen at all, though I only have access to Windows 10. The general issue phetsims/scenery#275 has been closed because starting May 2015 developers began to report that this is no longer an issue. @samreid can this issue be closed?

@samreid
Copy link
Member Author

samreid commented Dec 30, 2019

Yes, thanks! Closing.

@samreid samreid closed this as completed Dec 30, 2019
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

5 participants