|
|
So I got my simulation in C# to run 1000 particles at a decent speed
(~20 fps), and I thought this would be a good time to try comparing it
to C++.
As much as possible, I ported the data structures and algorithm straight
across. And the result... surprised me.
The C++ release build, targetting SSE/SSE2, could only run ~500
particles before choking.
Thinking this might be an effect of the frequent allocation /
deallocation of new arrays, I switched the C++ version to preallocate
the arrays.
Nada. No difference at all in speed.
Now, I'm thinking I'm seriously doing something wrong here with the C++
version, but I can't figure it out. And without a profiler, I can't
spot bottlenecks in my executable.
Anyway, other than that, it runs fine. If anyone wants to take a look
at it, they can at http://www.pacificwebguy.com/downloads/physics.zip
(~450k, C++ source included).
--
...Ben Chambers
www.pacificwebguy.com
Post a reply to this message
|
|