godot-extended-libraries / hydro

Hydro is a Godot Engine module which allows rigid bodies to behave realistically in water.
MIT License
63 stars 15 forks source link

Performance profiling #5

Closed fire closed 3 years ago

fire commented 4 years ago

Are you able to create a stress scene so I can run a profile?

jonri commented 4 years ago

Yes, certainly! To start with I'm thinking we should have a scene with one high-poly object and a scene with many lower-poly objects. In addition to getting a baseline profile, those are the two most obvious areas that we could consider running the calculations in parallel and we'd be able to use these scenes to evaluate any improvement from doing so.

The other potential bottleneck to test would be the wave height gdscript callback function, so we'll also want a scene with an object under no wave function, a constant wave function, and a complex one.

jonri commented 4 years ago

@fire Let me know if you think I'm going down the right path with this:

StressTest.zip

So far, all the scenes test with an object totally underwater, this isolates and makes consistent the code to calculate the forces. We'll want one with objects on the surface too, in order to hit the mesh clipping function too. I was also going to add a scene with 100 objects but the same face count.

Once we have a nice suite, these might be able to double as both performance and regression tests. If these are in line with what you're looking for, I think they'll warrant inclusion in the repo so that anyone could perform the same tests.

jonri commented 4 years ago

@fire I decided to convert this into a script that allows different numbers of objects and faces to be specified. When the objects sink to a specified depth, the script will print some stats and exit. This should allow for more versatility in running this from various profilers, automated test suites, etc. I've added a small section to the wiki on how to use it.

Let me know if https://github.com/godot-extended-libraries/hydro/commit/d9f4aa19a28dbd91d195b2f36a49a8499d053f76 is sufficient for your profiling work, I used it with perf on Linux and have already found some interesting results.

fire commented 4 years ago

Will contact you directly, but the summary was things happened and I rethinking my projects.

jonri commented 3 years ago

I've found this stress test to be more than adequate for profiling myself, if we decide to increase its scope for use in other areas we can detail such use cases in a separate issue.