"Peted" wrote in message news:uv********************************@4ax.com...
hi,
im wondering if there is a definitve answer to this.
I am tracking with Peter on this one, as there are some cases where C++
smokes C# and a few where C# smokes C++. In general, both are fairly
equivalent. And, in those cases where you need something native, you can
always write in C++ for the algorithms that need that tweak.
If you build a winforms/wpf application in vs2008, when you have
compiled and run the app, does it run as fast (in general) as if you
used something like a xenocode compiler to convert to native code.
I would say yes, as there is generally not a lot of difference in speed of
UI, business logic and data access. When you move to serious graphical
calculations, as you suggest later, you might see a difference. I am not
sure I would use Xenocode to do this; it would probably be better to bite
the bullet and do it all in C++.
I hear things like the xenocode option only makes a minor speed
improvement in startup.
Not sure, but the startup time is definitely less if you do not have to JIT.
So what if you wanted to write a game in c# using the directx sdk.
Would you be better of using c++.
I would disagree a bit with Peter on this, as it would probably depend on
the game. Overall, since the majority of your graphics code is in the
DirectX libraries, there should not be a lot of difference, but you might
end up with a difference with certain types of game physics.
How can one know if there is a performance impediment in the whole
dotnet bytecode to native realtime conversion
I have found none, but I have not written a lot of gaming code. There are a
few cycles each time you marshall from managed to unmanaged, but this would
not be a major impediment unless you were constantly marshalling, as in a
very large loop. It would be easy enough to set up a simple application that
hits some DirectX bits and profile it both in native and managed. I believe
you will find that the calls add a few microseconds to the time, which is
neglegible in most cases.
That being said, I not sure I would write a game like Quake 4 in C#. ;-)
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss
or just read it:
http://gregorybeamer.spaces.live.com/
********************************************
| Think outside the box! |
********************************************