Relatively empty BEPU scene, 100% CPU, possibly my own fault
Posted: Mon Jul 20, 2015 8:45 am
So I have a scene entirely devoid of entities.
Instead, it has a ton of staticmeshes.
However, my i7's CPU usage is at 100%... when I trace things with slimtune, I catch this:
37% of all calculation time is... BEPU. Doing... nothing?
So when I said I had a ton of staticmeshes, I meant I had a few thousand, each with a few thousand triangles.
So... millions of triangles.
However, they are /static/ triangles. Not worth so much as a quick and easy loop-through!
I'm currently putting off the 'make my own physics objects for BEPU so I don't have static mesh objects everywhere eating RAM' plan... in part because that would theoretically create /more/ static objects. That BEPU seems to loop through needlessly or something like that.
(Here's the best bit: Almost all the rest of the time used is Thread.Sleep(). Don't ask me how sleeping the majority of the time creates 100% CPU usage.)
When I reduce the StaticMesh count to a few hundred, BEPU takes ~8% of the tick time, and CPU usage reverts to sane amounts (around 2%)
So, it's something about BEPU not liking big numbers of staticmesh's.
NOTE: "a few thousand" and "a few hundred" are terrible and probably massively overestimated guesses.
It's probably actually closer to less than one thousand and less than one hundred. I haven't bothered doing the math to figure it out. Surface area of a giant cuboid...
Instead, it has a ton of staticmeshes.
However, my i7's CPU usage is at 100%... when I trace things with slimtune, I catch this:
37% of all calculation time is... BEPU. Doing... nothing?
So when I said I had a ton of staticmeshes, I meant I had a few thousand, each with a few thousand triangles.
So... millions of triangles.
However, they are /static/ triangles. Not worth so much as a quick and easy loop-through!
I'm currently putting off the 'make my own physics objects for BEPU so I don't have static mesh objects everywhere eating RAM' plan... in part because that would theoretically create /more/ static objects. That BEPU seems to loop through needlessly or something like that.
(Here's the best bit: Almost all the rest of the time used is Thread.Sleep(). Don't ask me how sleeping the majority of the time creates 100% CPU usage.)
When I reduce the StaticMesh count to a few hundred, BEPU takes ~8% of the tick time, and CPU usage reverts to sane amounts (around 2%)
So, it's something about BEPU not liking big numbers of staticmesh's.
NOTE: "a few thousand" and "a few hundred" are terrible and probably massively overestimated guesses.
It's probably actually closer to less than one thousand and less than one hundred. I haven't bothered doing the math to figure it out. Surface area of a giant cuboid...