phetsims / gas-properties

"Gas Properties" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 6 forks source link

Performance problem in State wrapper. #243

Open pixelzoom opened 6 months ago

pixelzoom commented 6 months ago

As noted in https://github.com/phetsims/gas-properties/issues/231#issuecomment-2111164253, performance in the State wrapper is jerky. Whenever state is restored, the Downstream sim has a noticeable pause. The pause gets longer as the number of particles increases, so it's a scalability problem. (I have not quantified how much longer, but it's qualitatively obvious when running the State wrapper.)

Particle instrumentation uses the same pattern as Projectiles in PDL. That sim experiences the same pause in the State wrapper. @samreid said that the PDL team did not choose to optimize for that case, so perhaps we can also ignore this for Gas Properties. But I am not clear on what uses cases would be impacted by this performance problem, whether this is problem is symptomatic of the pattern adopted from PDL, or whether there's an alternative pattern that would be more performant.

Assigning to @arouinfar @Nancy-Salpepi to decide whether we need to address this.

pixelzoom commented 5 months ago

5/28/24 status meeting with @arouinfar @kathy-phet @KatieWoe @pixelzoom

There is no current use case that this will impact. Playback will probably be a problem, and it's unfortunate that this approach (also used in PDL @samreid @matthew-blackman ) is not scalable. But until a use case is identified, this issue is deferred, and we'll skip it for the 1.1 release #191.