Search code examples
performanceprocessingsettingssystem

Processing: increasing performance?


This question is specifically related to the program Processing.

Does anyone know if Processing is by default limited to CPU/RAM usage defaults? I'm integrating it into a facility at my university on a ridiculously powerful system (24 cores, 36GB in graphics power and a stupid amount of RAM). Yet, some sketches run at a poor frame rate (10-20 per second), which isn't much better than my MacBook Pro, so I feel there's something wrong. I've tried multiple renderers as well. For example, the flocking example that comes with Processing couldn't handle more than a few hundred objects (which wasn't much more than any other computer could), or with 3D scenes only a few hundred boxes causes a very laggy navigating experience. OPEN GL rendering didn't seem to make a big difference.

Does anyone know what this might be? It's been hard searching for "processing performance" in relation to the actual program "Processing". Thanks!


Solution

  • Can you please be more specific than saying you're expecting your sketches to run better? What exactly does better mean?

    Keep in mind that Processing defaults to 60 frames per second, which is independent of the hardware you're running it on. You can adjust this by calling the frameRate() function. More info can be found in the reference.

    Also note that Processing uses a single thread to do all of its rendering and event callbacks. So throwing more CPU cores at it won't really do much, unless you specifically offload some of your work to another thread. And with a graphics-driven framework like Processing, that can be more work than it's worth.

    Can you please post a MCVE (just enough code so we can copy and paste it to run ourselves, not your full project) that shows exactly what you're trying to do? Don't forget to include exactly what you expect to happen compared to what actually happens.