Benchmark: Bullet - PhysX2 - PhysX3
by Timmy01 · in Torque 3D Professional · 03/03/2014 (6:49 pm) · 8 replies
I finally got around to doing some very basic benchmarking of the physics plugins.
System Specs:
OS: Windows 8.1
CPU: Core i7 2600
Ram: 8GB
GPU: NVIDIA GeForce GTX 560 Ti
Compiler: VS 2010 in release mode
T3D Version: 3.5
PhysX 2: 2.8.4
PhysX 3: 3.3
Bullet: 2.81
For the physx3 plugin i used the physx3_basic branch from my repo here github.com/rextimmy/Torque3D/tree/physx3_basic. I used this instead of the more feature rich physx branch simply because it doesn't modify any files outside of the plugin base. I also used this same branch for the physx2 and bullet builds too, it's based off T3D 3.5 development branch with the only difference been the addition of the physx3 plugin. I have left everything with the physics plugin in it's default state, so timing and thread count etc is exactly the same as the default T3D download.
To run the benchmark i created a small class called (suprise) benchMark and all it does is run for X amount of seconds and dumps the FPS at one second intervals. From core/scripts/client/mission.cs i added the following
So the benchmarking class is the only other addition to the engine code. Works great, you just run a level sit back and it runs for X amount of seconds and than disconnects and spits you back out to the main gui where you can run the tests again and again.
To obtain the results i ran each test level 4 times and took the averages for these 4 runs.
I had three test levels, one with 400 boxes, one with 800 boxes and the last with 1200 boxes. The time (in seconds) is displayed down the bottom with the FPS up the side.
Results:



I do have the profile data to go with this if anyone wants to see that too.
Disclaimer:
Obviously this is not the best real world example because all it is doing is dropping boxes and how many games do you play where you see 1200 boxes fall out of the sky and nothing else ;-). There is no raycasting or sweep tests etc so maybe one day if i get more free time a better benchmark would be in order.
Neither Physx version is using any GPU acceleration, it's all cpu based.
System Specs:
OS: Windows 8.1
CPU: Core i7 2600
Ram: 8GB
GPU: NVIDIA GeForce GTX 560 Ti
Compiler: VS 2010 in release mode
T3D Version: 3.5
PhysX 2: 2.8.4
PhysX 3: 3.3
Bullet: 2.81
For the physx3 plugin i used the physx3_basic branch from my repo here github.com/rextimmy/Torque3D/tree/physx3_basic. I used this instead of the more feature rich physx branch simply because it doesn't modify any files outside of the plugin base. I also used this same branch for the physx2 and bullet builds too, it's based off T3D 3.5 development branch with the only difference been the addition of the physx3 plugin. I have left everything with the physics plugin in it's default state, so timing and thread count etc is exactly the same as the default T3D download.
To run the benchmark i created a small class called (suprise) benchMark and all it does is run for X amount of seconds and dumps the FPS at one second intervals. From core/scripts/client/mission.cs i added the following
function clientStartMission()
{
........
//run benchmark for 20 seconds and run disconnect script function when done
benchMarkStart(20,"disconnect();");
profilerEnable(true);
}
function clientEndMission()
{
........
%time = getRealTime();
profilerDumpToFile("results/profile_"@%time@".txt");
profilerEnable(false);
benchMarkDumpToFile("results/benchmark_"@%time@".txt");
}So the benchmarking class is the only other addition to the engine code. Works great, you just run a level sit back and it runs for X amount of seconds and than disconnects and spits you back out to the main gui where you can run the tests again and again.
To obtain the results i ran each test level 4 times and took the averages for these 4 runs.
I had three test levels, one with 400 boxes, one with 800 boxes and the last with 1200 boxes. The time (in seconds) is displayed down the bottom with the FPS up the side.
Results:



I do have the profile data to go with this if anyone wants to see that too.
Disclaimer:
Obviously this is not the best real world example because all it is doing is dropping boxes and how many games do you play where you see 1200 boxes fall out of the sky and nothing else ;-). There is no raycasting or sweep tests etc so maybe one day if i get more free time a better benchmark would be in order.
Neither Physx version is using any GPU acceleration, it's all cpu based.
About the author
#2
If you see the profile data, bullet BtWorld_TickPhysics is always the number one cpu hog, i wonder if there is any optimizations that can be done on the bullet plugin? I don't know bullet that well myself.
03/03/2014 (7:13 pm)
One thing you really notice with both bullet and physx2 is you can see the FPS dropping as the boxes are dropping and than they both level out once they hit the terrain. Physx3 seems hardly affected and keeps itself fairly steady. If you see the profile data, bullet BtWorld_TickPhysics is always the number one cpu hog, i wonder if there is any optimizations that can be done on the bullet plugin? I don't know bullet that well myself.
#3
03/03/2014 (7:37 pm)
Woo, those are good results! Just out of curiosity what do you get on the same 1200 box test with GPU acceleration ?
#4
I would like to benchmark the GPU cloth stuff though, so i might add this in too (obviously a physx3 only thing).
I'll try and run the tests again this week and crank up the smThreadCount on the physics plugins and see how that changes any of the results.
03/03/2014 (7:46 pm)
There is no GPU rigid body acceleration in physx3 currently,NVidia have only enabled it for cloth and particles. I think i read somewhere they are working on it??I would like to benchmark the GPU cloth stuff though, so i might add this in too (obviously a physx3 only thing).
I'll try and run the tests again this week and crank up the smThreadCount on the physics plugins and see how that changes any of the results.
#5
03/03/2014 (7:53 pm)
I guess i could enable GPU for the physx 2.8 plugin though and see if it performs better than physx3. Sorry if this is what you originally ment ;-)
#6
03/03/2014 (9:26 pm)
Oh yeah im wrong about physx 2.8, it only supports cloth,softbody & fluids with GPU. It was only ever supported on those ageia ppu's, i always thought nvidia ported that all to cuda but obviously i was mistaken.
#7
do u have a level that u can share that u used to test this with? We are using Bullet and not seeing the FPS hit like this. Id like to make sure that we didn't miss a test.
03/04/2014 (5:30 am)
@Timmy - do u have a level that u can share that u used to test this with? We are using Bullet and not seeing the FPS hit like this. Id like to make sure that we didn't miss a test.
#8
I guess the main point of the testing was to see how each performed when getting pushed pretty hard. As you can see PhysX 3.x hammers the other two. If you have a game that makes decent use of physics, i highly recommend PhysX 3.x. Honestly everyone test for yourselves and you will see similar results.
03/04/2014 (5:43 am)
It is likely you won't see a huge FPS drop until you start really pushing it. The lowest test i did was with 400 boxes all falling at once, that is a scenario you are unlikely to come across in a real world game. I just used the terrain level that ships in the full template and just added the boxes(PhysicsShape datablock).I guess the main point of the testing was to see how each performed when getting pushed pretty hard. As you can see PhysX 3.x hammers the other two. If you have a game that makes decent use of physics, i highly recommend PhysX 3.x. Honestly everyone test for yourselves and you will see similar results.
Torque 3D Owner JeffH