22-11-2022, 12:55 AM
Hello,
I just recently purchased this asset to see if it would be possible to use it for simulating aerodynamics and ran into some performance issues when trying to simulate lots of fluid particles. The low hanging fruit seemed to be tons of GC Allocations per frame in the ObiFixedUpdater/ObiSolver (Using Burst).
The following profiler was run with about 10,000 particles with Collision and Density Contsraints enabled. I did notice that when Disabling Density, the GC Alloc drops quite abit and performance improves.
Density disabled:
Deep profiler shows that the issue comes from setting the capacity of the List every frame and calling ToArray on it. (I was able to fix this by just using an array instead of a list and only allocating memory when the capacity needed to grow).
Here is a video of the scene I was running and what I'm trying to do. Not sure if you have any better suggestions on how I could go about trying to do an aerodynamics simulation (for a high speed boat / hydroplane)?
I just recently purchased this asset to see if it would be possible to use it for simulating aerodynamics and ran into some performance issues when trying to simulate lots of fluid particles. The low hanging fruit seemed to be tons of GC Allocations per frame in the ObiFixedUpdater/ObiSolver (Using Burst).
The following profiler was run with about 10,000 particles with Collision and Density Contsraints enabled. I did notice that when Disabling Density, the GC Alloc drops quite abit and performance improves.
Density disabled:
Deep profiler shows that the issue comes from setting the capacity of the List every frame and calling ToArray on it. (I was able to fix this by just using an array instead of a list and only allocating memory when the capacity needed to grow).
Here is a video of the scene I was running and what I'm trying to do. Not sure if you have any better suggestions on how I could go about trying to do an aerodynamics simulation (for a high speed boat / hydroplane)?