Increasing maximum available memory testing. How to get better results?

edited June 2018 in Using Processing

This is a i7-8700, 32Gb of RAM, NVIDIA GeForce GTX 1080, running Windows 10 and Java 8 (171) installed and heap memory set to max 32Gb(-Xmx32g) (?) on run parameters.

I think this is not a question about library. However, as experiment, I am running an example from box2D library for processing named Liquidy.pde where I changed the sketch sizeto (600,300) and tested 3 renderers (default, JAVA2D and P3D). P2D was way too slow to be considered at this point. I am printing the total memory, allocated memory, free memory, n of particles, fps in the title of the sketch. I am also declaring the sketch to run at 60 fps using frameRate(60); I have tried to increase maximum available memory, but when the option was disabled, I have got a slightly better performance in fps.

When running the sketch, a click of mouse will generate a particle system. 10 clicks would generate an environment with about 1000 particles, and 15 clicks will stay around 1700. See attached picture:

With 10 particle systems, each rendered kept sketch running around 60 fps:JAVA2D a little worse than default. P3D performed just a little better. for 15 particle systems, frame rate will decrease to 15 fps (P3D), 19fps (JAVA2D and default).

Disabling the "increase maximum available memory" in preferences (and restarting?) made default renderer and JAVA2D to perform a little better when running 15 particle systems. From ~20fps, they jumped to 25fps.

I am not running out of memory and I wonder if there is any way to improve the performance of my sketches. Thanks

Capture5

Answers

  • Also ask in the new forum

  • What makes you think that cpu intensive code like physics simulations will improve by increasing the memory? That might work for things that spend a lot of time garbage collecting but it's not a universal solution.

    I'm printing total memory, allocated memory, free memory, n of particles, fps

    Removing this, or only updating it once ever 100 frames will probably have more effect. Don't underestimate the cost of fetching data, converting that to text, rendering that as pixels and modifying the window chrome.

  • Println is also a bit buggy

  • He's doing it in the title bar so it's probably not the console output bug of yore (which was mentioned as fixed in recent release notes btw)

  • Thanks for the feedback. Sadly, commenting the lines retrieving all information to be displayed didn't change much the performance.

    What makes you think that cpu intensive code like physics simulations will improve by increasing the memory?

    I am a bit ignorant about how processing deals with hardware. I was expecting some slightly better performance with 32G instead of 8Gb Ram. I agree about the cpu, It shows 6 cores are not enough for this simple 2D simulation with less than 2000 particles. I also thought gpu could play some important role, but it seems it doesn't.

  • Probably it uses only one core

Sign In or Register to comment.