POV-Ray : Newsgroups : povray.off-topic : Speed comparison between C# and C++ : Speed comparison between C# and C++ Server Time
4 Nov 2024 13:12:46 EST (-0500)
  Speed comparison between C# and C++  
From: Chambers
Date: 17 Apr 2008 01:02:40
Message: <4806d9f0$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.