Odd and interesting, framerate C# vs C++

sarge

04-03-2006 15:24:01

For the fun of it I have set up a solution with two basically identicle projects.

The only difference is one is C# and the other is C++.

But they are just basic projects at this point. They load the same dotscene map I created and the same skybox. And all you really do is move the camera around to check out the map. There are no additional geometries added!

I inherit from the ExampleApplication class for both. Now I know there are differences between the two. And to be honest, I haven't really dug into it that much.

But still, in Release mode for both of them, I get a higher frame rate for the C# application then I do for the C++ one. And I am talking 100 fps more.

I average 450 with the C# application, and 350 with the C++ application.

I am using the exact same driver, same aliasing, everything!

My gut feeling tells me that the difference lies in the ExampleApplication class. I just find it odd that the difference would be that big.

The difference in debug mode is much smaller, but C# (inherited from the ExampleApplication class included with OgreDotNet) is still faster at 107fps vs 92!

Anyone else run into this? Certainly not necessarily a bad thing. But it does tell me I may be doing something wrong in my C++ project.

rastaman

04-03-2006 18:21:03

My first guess would be that the Ogre ExampleApplication uses immediate mode for input. Each frame it checks all the key inputs. Where ODN ExampleApplication uses events keyclick, keydown. Witch means ODN is not doing as much each frame. The difference is just a few if statements but that could be enough to affect the average FPS.