instable radix sort in particles demo the radix sort grows slower and slower with some settings

Hi,

I’ve got another question regarding the particles demo. If you enable the sliders and play around with them, there are some settings which make the framerate drop in a way that it doesn’t raise again afterwards. I’ve made some benchmarks on the code and found that it is the radix sort which gets slower every frame it is run. I know that physics simulations can be unstable but I don’t see how this could be the fault of the radix sort performed on the memory arrays? Can you give me an explanation on this?

Thanks in advance,
Joey

Or another question: does the radix sort depend on the contents of the array? It’s somehow a weird behaviour. If I sort without letting the particles collide, the sorting is way faster than with collision. And with collision, the sorting gets slower and slower… o.O I thought radix sort was linear in runtime.

You are referring to the demo in version 2.3 of the SDK (which has a better radix sort than older releases)? I have done a lot of benchmarking with that radix sort implementation and I found performance to be independent of the input distribution. Also performance does not degrade when calling the radix sort function many times in my benchmark.

Yep. I’ve a notebook card and thus using the 2.2 driver, but all the other demos run fine so I don’t think this is the reason for such a strange behaviour.
Well, I’m clueless. I’m attaching my whole project and hope someone can point me in the right direction. In the simulation.cpp is the step method which updates the particles every frame, there’s also some benchmarking code which writes a test2.txt file (you can import it in OpenOffice Calc as csv, replace . with , and make some diagram if you wish).

So please, can someone tell me why the radix sort gets slower every frame? Just run the program for, like, 20 seconds and you’ll see fps drop. The test2.txt file will show you which function call is the reason (fourth column), and it’s actually the sort call.

Thanks!
Joey
Falling_Sand_Game.zip (857 KB)