Closed KatieWoe closed 3 years ago
As I said in https://github.com/phetsims/qa/issues/662#issuecomment-873165491:
I'm not familiar with what the performance expectations are, or how performance might have changed due to recent PhET-iO changes. So please assign the issue to the PhET-iO team for evaluation.
This is a known problem, and playback performance has never been a blocking issue up to this point.
Yup. I only made an issue this time since it seemed to impact this sim more than others.
We realize that performance has not been a blocking issue up to this point. But @KatieWoe has reported "particularly long" pauses, which may or may not be related to recent PhET-iO changes. So perhaps the PhET-iO team should take a look, compare 1.4 to 1.5, and decide whether the performance is still non-blocking.
I did some investigation here, testing performance of NS on master with localFile recording and playback
My testing in general created a recording that loosely followed the steps to reproduce over in https://github.com/phetsims/studio/issues/223#issuecomment-875086340. That is a great way to get a stable population with quite a few bunnies churning through.
All in all I see nothing obvious or blocking-worthy in my investigation, but I also noted that it takes multiple seconds to create the bunnies for the next generation. That could be a usability concern in some contexts I think, but it also didn't feel that different or new from other, previous recordings of the same content.
My vote would be to have @pixelzoom speak to sprite performance, @samreid review this investigation and offer his opinion, and then, if all agree, close in lieu of uprooted entrenched patterns like merge
or something to gain better performance.
Another ~9% is coming from Imageable hit testing. I'm surprised to see that, and I was wondering if that from a recentish change to use sprites for the Bunnies etc. @pixelzoom do you think that is worth some investigation?
NS has been using Sprites since 7/20/20, so this is not a recent change. @jonathanolson and I spent a lot of time performance optimizing, and sim performance has been excellent. Since there seems to be a consensus that performance of the State wrapper isn't really important, I'm not inclined to put more work into optimizing Sprites, or NS's use of Sprites.
@kathy-phet and the gang determined this to not be blocking today.
Next steps for testing:
@samreid and I will take it from there.
@zepumph can you please try this patch? It's working great over here:
I tested more and checked the usages sites of scheduledPlaybackIntervals
and this seems good enough to push.
I committed the change and added a guard to prevent stack overflows. @zepumph can you please review? @KatieWoe can you please test on master?
Looks much smoother on master
Looks really great to me, over to @pixelzoom to cherry pick. @samreid will you want to do the same for GAO?
Yes, I'll update gravity and orbits in https://github.com/phetsims/gravity-and-orbits/issues/404, thanks!
Please summarize what needs to be cherry-picked. I'm guessing https://github.com/phetsims/phet-io-wrappers/commit/46731109c30c64c32ca7676c8146bd91fa88db32 and https://github.com/phetsims/phet-io-wrappers/commit/ee6afb8256d7fffd74ff50da28d54ca50c1995e2.
Yes, but please cherry-pick them in chronological order:
https://github.com/phetsims/phet-io-wrappers/commit/ee6afb8256d7fffd74ff50da28d54ca50c1995e2 https://github.com/phetsims/phet-io-wrappers/commit/46731109c30c64c32ca7676c8146bd91fa88db32
Steps to Reproduce a Recording:
?console
with ?localFile
and press enter/reloadwindow.saveLogToFile("name");
)Thanks @KatieWoe. I tested the fix by recording a stable population up to Generation 9. It's running smoothly. Patched in the 1.4 branch in the above commits. Ready for testing in the next RC.
I think this can be closed for rc.2. Will reopen if something else comes up
For https://github.com/phetsims/qa/issues/662. Same issue as https://github.com/phetsims/molecule-shapes/issues/177 and https://github.com/phetsims/gravity-and-orbits/issues/376. Seems to be to a larger degree.
When you play back a recording the playback wrapper will pause and speed up at certain places. All events are still recorded and this does not seem to be impacted by either the platform that made the recording or the one playing it back. On NS, the pauses seem particularly long and are concentrated between generations. These pauses were not necessarily there when the recording was made.