Stucuk wrote:It looks like he is right. I recreated his test in Delphi and 2.06 and 2.03 are slower with a 10x10x10 box stack. Note that when Autosleep is turned on 1.53 is still faster.
You can download the source + "Interactive" (As in you can set the PlatformArchitecture, SolverModel and AutoSleep at runtime) Applications for 1.53, 2.03 and 2.06 below. Included is all DLL's, etc.
I run the test and yes you are right 1.53 is about twice as fact.
These totally correct, 1.53 have and exact solver, and mean a real complementary solver it is not a joke.
If you have simple stacked of bodies that are just resting, there the solve will be fasters than anything
This Is explained by the time complexity of the solver which goes from linear to quadratic.
So in a small stack when the bodies have zero velocity, and they are in perfect equilibrium after the first pass the solver only do one pass, to calculate the forces since the force of the previous frame do not change.
However of the bodies in the stack are moving then the solver can take unto n x n passed to find the solution.
In 2.0x the solver is a linear time complexity by it is not an exact solver, so since the number of passes if fix even if the stack is at rest.
hpesoj wrote:@Stucuk - I'm starting to think I just misunderstand how the solver models work (see below). Also, I'm pretty sure NewtonSetSolverModel in 1.53 does absolutely nothing (though everyone except me probably already knew this).
This is no true solver model are different in 1.53 you do no notic ethe diffrence becaus eyou are testion a scen that is mostly static.
Basically you are measuring teh idle peroformance ef the engiene. which in 1.53 is amost zero.
2.04 is desegned for working with multicores, therefore some algothsmm clevermeness have to be given up for teh sake of data parallelism.
hpesoj wrote:@Julio - I shouldn't have mentioned 1.53, my problem isn't that 2.0x doesn't behave like 1.53. I have tried various setups of stacks using both 2.0x and 1.53, and and the 1.53 exact solver behaves far more erratically, and crashes with high numbers of bodies (you must have changed something for 2.0!). Thus, as you say, it is pointless to waste time comparing 1.53 to 2.0x. Forget I ever mentioned 1.53
.
This is right 1.53 will crash of you stack more than 512 bodies in one pile. The spedd will be so slow the it poinless to use it. Remember 1.53 was release in 2003 at a time the stack of 100 bodie was unthinkable until some people came up with pseudo Laws of physics to make commercial engines that do not really work.
hpesoj wrote:I have found that in scenes with perfect upright stacks of boxes which aren't toppling, the exact solver is faster than the adaptive and linear solvers. Once the stacks are set toppling/moving, the exact solver becomes very slow, and with imperfect stacks (small random offset added to each box) exact and adaptive perform about the same. Now that I think about it, this probably makes sense: I'd imagine that an exact solver will be able to solve "perfect" systems like this very easily, more easily than the adaptive and linear solvers. This is just speculation, so I would very much like to hear what you have to say Julio.
As you noticed this is quite correct.
And it it explained by the time complexity of the solver algorithm.
To make an analogy say the you have a let up compare insertion sort to radix sort.
If you have need to sort and array constantly I will chose insertion sort because if the change are not too many insertion source work in linear time, and force a perfect sorted array is work in one pass.
However insertion sort have a quadric time complexity for random permuted arrays.
Radix sort on the other hand have a linear time complexity by it is high fix cost, since you will have to make a minimum of 5 passes for and 32 bit key array plus it requires extra space.
So Insertion sort for array that are almost organized will smoke Radix sort, but it will lose big time for random arrays.
It is the same with a complementary solver if the solution of eth previous frame is exact, and the state of each body doe no change form frame to frame the 1.53 will find a solution in one pass.
However if the state of eth bodies are changing then 1.53 will spend upto N passes to find the exact solution, by that solution will no help on the ned frame solution.
hpesoj wrote:The linear solver, even when performing only 2 iterations, is never faster than the adaptive solver. Perhaps the linear solver doesn't provide much of a performance increase with rigid body collisions and stacking? Is the linear solver only designed to speed up joint operation? (I haven't tried stress tests with joints yet)
There is no such thing as adaptive solver in 2.0x
There are not difference between joint and collision in Newton, you can see in the interface than the pointer to a joint is the same as the pointer to a contact.
The only different is that contact joint are managed by the collision system internally.
In 1.53 the there is a big difference between adaptive and exact solver, they both have quadratic time complexity, but the algorithm for calculation friction forces in the exact solver is part of the solver, and it make take a like more steps. Exact solver is a one pass solver that calculate friction and normal forces at once.
In the adaptive solver is a two pass solver, is used the solution form previous frame to calculate the normal forces, then using the new forces and the friction from the previous frame is execute another pass for calculation all the forces.
This reduces the number of passes especially on stack that are unstable, but it can be slower tah the exact solver if the body motion is too fast.
The linear solve limited the number of passes of eth exact solver to a fix value and return with and approximation of the solution.
In 2.0x the linear solver is a complete iterative algorithm, some setting solve mode to one execute one pass, setting to 2 do tow passes and so on.
The exact solver is the same as it was in 1.53 with some bug fixed.
All in all 2.0x is by far superior than 1.53 saying that 1.53 is faster is the equivalent to saying the Bubble sort is faster than Quick sort when this is only they for a very special case.