Hello everyone, I have been working on a configurable audio reactive visualizer for a while now, and have come to the point where I have some issues with performance that I’ve yet to identify the cause of. The name of the application is Fractaleyez; all the code is open source and can be found here for reference. The application is integrated with React for all the UI elements to adjust the visualization. The data is taken from React state and fed to the three.js canvas on each animation frame. Most of these adjustments can be made in real time with minimal visual disruption to the scene; however, the Particle Config
category requires that the scene be deleted and regenerated with entirely new particles. This is where I’m seeing the biggest performance hit. I ran the performance monitor Chrome tool on my production build over 15 seconds to illustrate various cases. The first 5 seconds always consisted of a fresh instance with no interaction. Every test case had Emancipator’s newest album, Mountain of Memory, playing in the background.
The first test consists of visuals running on their own in default mode with no interaction.
The second test consists of visuals running with adjustments to categories other than Particle Config.
The third test consists of changes to Presets only.
The fourth test consists of major adjustments to Particle Config.
The final test is a 60 second run where I was adjusting the Particle config more heavily.
As you can see, the performance oftentimes gets cleaned up by the garbage collector but there are times when the application will crash instead or perform poorly until restarted. You can also see that the number of nodes and heap size steadily increases despite any garbage collecting. I have attempted to clear the scene here and reset the visualization here, but I’m not sure if I’m doing everything properly. I would appreciate any help on this as I’ve spent a lot of time working on this project, but I am by no means an expert with Threejs. I’m open to questions or advice on any part of the application; my goal is to make this visualizer easy enough for anyone to pick up and use and flexible enough to create custom visual sets for more advanced VJs.
Thanks in advance for anyone who took the time to read and process all this info!