phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Lag outside of play area #47

Closed KatieWoe closed 1 year ago

KatieWoe commented 2 years ago

For https://github.com/phetsims/qa/issues/823. Seen on iPadOS 15. I saw on the iPad that if a particle was flying off (such as an electron after B- decay) it would start to lag once it left the play area. Specifically, the area that would be present if the sim was in landscape is what I'm calling the play area. If the iPad is in portrait mode and the particle flies up or down into the large amount of whitespace, that is where I see the lag.

https://user-images.githubusercontent.com/41024075/184675599-fce533a2-d26f-4871-bc8a-53be9725ea5c.mov

Luisav1 commented 2 years ago

@chrisklus and I looked at the code that emits a nucleon and found nothing that would cause a lag once a particle leaves the play area. Then checked the performance profile to see if we could find any BAN functions but only found this layout call in purple. We're not convinced that this is sim code that's causing the problem, it could be code in scenery instead. @jonathanolson have you seen an issue similar to this before? Note the stacks on the left side are when the particle is animating inside the dev bounds and the ones on right are when it leaves the dev bounds. image

jonathanolson commented 2 years ago

Interesting, that might be due to DOM operations. @jessegreenberg is it possible to run without any parallel DOM view for testing?

Additionally, can you try with the preventFit: true option on the ScreenView?

Luisav1 commented 2 years ago

Thanks @jonathanolson, preventFit: true has fixed the problem. I'll leave this open to be verified in the next RC https://github.com/phetsims/qa/issues/828.

jessegreenberg commented 2 years ago

Also, I just verified this sim doesn't support Interactive Description, so there are no PDOMPeers or related HTML elements in the DOM.

chrisklus commented 2 years ago

For QA: Please close if this is fixed. Thanks!

Nancy-Salpepi commented 2 years ago

In 1.0.0-rc.10, I still see the particles sputtering a bit (even in the play area), but I think that is because my iPad is older. I am using an iPad air 2. However, the sputtering is significantly less than it was outside of the play area when comparing with an older version.

https://user-images.githubusercontent.com/87318828/188955186-cda7eb2c-afb7-4181-a21d-4328686a7322.mov

stemilymill commented 2 years ago

https://github.com/phetsims/qa/issues/833

this seems to be improved but not totally fixed, and my observations are different than Nancy's

On my ipad (pro 10.5 inch) the only sign of lag I saw in dev.14 was the particle briefly freezing as it exited the play area. in the rc.10 version, the freezing is less noticeable and also only occurs when the particle is going up- when the particle exits the play area going downward, it continues without sputtering.

On Win10 Chrome (dell laptop) in dev.14 when a particle leaves the play area, various visual elements seem to vibrate up and down until the particle completely disappears. I did NOT observe any of this in rc.10.

ariel-phet commented 2 years ago

Although we should leave this issue open for further investigation, the behavior looks good enough for prototype publication.

zepumph commented 1 year ago

I investigated this a bit more, and could reproduce it with 6x slower CPU in the dev tools. It is a faint lag bug noticeable. I'm not really sure how to investigate this further, but I did put preventFit onto both screen views.

zepumph commented 1 year ago

After talking with JO, preventFit still feels like the best path forward. I'll mark this to see what QA thinks about it now.

zepumph commented 1 year ago

(Fingers crossed over here) QA feel free to close if all is good.

KatieWoe commented 1 year ago

I didn't see any lag on my iPad with this

Nancy-Salpepi commented 1 year ago

For https://github.com/phetsims/qa/issues/988 On my iPad (9th generation) with iOS 17 I am seeing some sputtering. It is more noticeable on the Chart intro Screen. It isn't unusable or anything, but thought I would let you know.

https://github.com/phetsims/build-a-nucleus/assets/87318828/1bd5a6f1-8cf3-4068-907f-8f135699f5d8

zepumph commented 1 year ago

Given the amount of time spent on this issue, and the amount of UX concern it entails, I think we should reclose. I also feel like we are doing the best we can without substantial changes. Thanks for the report though!