POV-Ray : Newsgroups : povray.off-topic : Speed comparison between C# and C++ : Re: Speed comparison between C# and C++ Server Time
4 Nov 2024 13:13:44 EST (-0500)
  Re: Speed comparison between C# and C++  
From: scott
Date: 17 Apr 2008 03:42:54
Message: <4806ff7e@news.povray.org>
> 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.

Looks nice, but I'd say it definitely looks GPU bound for some strange 
reason rather than CPU bound on my PC:

Particles  FPS   CPU %
   0       60    00
 200       60    00
 300       60    01
 320       30    05

Drawing 320 particles should NOT run at only 30 fps!  See attached little 
demo* I made, it draws 30000 cubes in the view, and on my machine runs at 
around 100fps (you can move around with the arrow keys).

What I would add to your program to debug further:

a) Add an option to disable rendering each frame (ie just do the physics)
b) Add an option to disable the physics each frame (ie just draw the 
spheres)
c) Add an option to disable the console output (it might be affecting frame 
rate)
d) Add an option to disable the vsync that is limiting the frame time to 
multiples of 1/60th second (your code might be blocking while waiting for 
vsync?) and anyway it's useful for seeing how fast your code really is


*
BTW you might need d3dx9_35.dll if you don't have exactly the right DirectX 
version, I haven't included it because it's quite big (3.5 MB), but you can 
download it from here:

http://www.dll-files.com/dllindex/dll-files.shtml?d3dx9_35

Officially MS want you to release the DirectX installer with your DirectX 
application, but when your program is only 42KB it seems a bit pointless to 
include an installer and then the DirectX installer as well.


Post a reply to this message


Attachments:
Download 'boxes.zip' (43 KB)

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