phetsims/neuron

Can NeuronProfiler be removed?

Closed this issue · 2 comments

In phetsims/joist#534 we are considering eliminating sim.frameStartedEmitter and sim.frameEndedEmitter, since sim.stepSimulationEmitter has been introduced. I was wondering if NeuronProfiler is still valuable to maintain, or whether it has been superceded by our other profiling tools (including ?profiler or modern Chrome Dev Tools). If we decide to keep it, could it be written in terms of sim.stepSimulationEmitter or is it critical to keep it in terms of sim.frameStartedEmitter and sim.frameEndedEmitter?

In phetsims/joist#534 we decided to keep sim.frameStartedEmitter and sim.frameEndedEmitter so it would probably be safe to close this issue with no work. However, I thought it would still be good to discuss this part:

I was wondering if NeuronProfiler is still valuable to maintain, or whether it has been superseded by our other profiling tools (including ?profiler or modern Chrome Dev Tools).

NeuronProfiler has the ability to start and stop the gathering of profiling data at specific times (triggered via its API) and log the data it gathers to the console or pop it up in an alert window in iOS. This provides much more specific information than the profiler does. At the time of the sim's initial development, this was very useful since the performance issues occurred during very specific time intervals, such as when the action potential reached the axon cross section. I think it's worth keeping in case further optimization is ever required. I've added some of what I wrote here to the header so that it's easier for future maintainers to figure out what it might be good for. Closing.