By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,127 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,127 IT Pros & Developers. It's quick & easy.

VS.NET Perfomance and speed question ( Comparing with C++ Apps)

P: n/a
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)

---
Best Regards
Herr Lucifer

Jul 21 '05 #1
Share this Question
Share on Google+
18 Replies


P: n/a
managed code would be the wrong answer for a challenge like writing a chess
engine or doing heavy graphics work.

"HerrLucifer" <He************@yahoo.com> wrote in message
news:Op*************@TK2MSFTNGP11.phx.gbl...
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)

---
Best Regards
Herr Lucifer


Jul 21 '05 #2

P: n/a
Why? Then how is the world going to be all in .Net in future? Won't
microsoft solve this issue?

"Greg Young" <gr********@planetbeach.com> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
managed code would be the wrong answer for a challenge like writing a chess engine or doing heavy graphics work.

"HerrLucifer" <He************@yahoo.com> wrote in message
news:Op*************@TK2MSFTNGP11.phx.gbl...
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and speed is extremely important for my application development. I have done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go the right path!). But I know C++ exe files use "KERNEL32.DLL" directly while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always the winners)

---
Best Regards
Herr Lucifer



Jul 21 '05 #3

P: n/a
I disagree. Unlike Java, .NET does not require a Virtual Machine to run.
..NET uses JIT Compilation -- you'll hardly notice a difference.

Heavy graphics work can utilize DirectX in .NET using the DX SDK, which
would allow it to be as fast as C++.

--
Alex Papadimoulis
http://weblogs.asp.net/Alex_Papadimoulis
"Greg Young" <gr********@planetbeach.com> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
managed code would be the wrong answer for a challenge like writing a chess engine or doing heavy graphics work.

"HerrLucifer" <He************@yahoo.com> wrote in message
news:Op*************@TK2MSFTNGP11.phx.gbl...
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)

---
Best Regards
Herr Lucifer



Jul 21 '05 #4

P: n/a
I should clarify that doing the actual graphics library in .net would be a
bad idea.

"Alex Papadimoulis" <al**********@pa3.14padimoulis.com> wrote in message
news:u%****************@tk2msftngp13.phx.gbl...
I disagree. Unlike Java, .NET does not require a Virtual Machine to run.
.NET uses JIT Compilation -- you'll hardly notice a difference.

Heavy graphics work can utilize DirectX in .NET using the DX SDK, which
would allow it to be as fast as C++.

--
Alex Papadimoulis
http://weblogs.asp.net/Alex_Papadimoulis
"Greg Young" <gr********@planetbeach.com> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
managed code would be the wrong answer for a challenge like writing a

chess
engine or doing heavy graphics work.

"HerrLucifer" <He************@yahoo.com> wrote in message
news:Op*************@TK2MSFTNGP11.phx.gbl...
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)

---
Best Regards
Herr Lucifer




Jul 21 '05 #5

P: n/a
When you get into code that you are actually considerring writing inline
assembler for because your C compiler generates slow code ... .NET is not
the right choice. these are specialized examples where speed is the only
concern ...

"HerrLucifer" <He************@yahoo.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Why? Then how is the world going to be all in .Net in future? Won't
microsoft solve this issue?

"Greg Young" <gr********@planetbeach.com> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
managed code would be the wrong answer for a challenge like writing

a chess
engine or doing heavy graphics work.

"HerrLucifer" <He************@yahoo.com> wrote in message
news:Op*************@TK2MSFTNGP11.phx.gbl...
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and speed is extremely important for my application development. I have done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go the right path!). But I know C++ exe files use "KERNEL32.DLL" directly while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always the winners)

---
Best Regards
Herr Lucifer




Jul 21 '05 #6

P: n/a
You can also have assembler code in managed c++ applications,
so called mixed executables.
Or you can have the code externally in native compiled Dlls, which
are called from managed code. E.g. the application written in
C# calling code written in managed C++ or native C++.

You´ll have the advantages from both worlds.
Rapid prototyping and fast code.

It´s also possible to have fast games written in managed c++
Have a look at the following article:

http://www.codeproject.com/managedcpp/quake2.asp

Andre


"Greg Young" <gr********@planetbeach.com> wrote in message news:Oi**************@TK2MSFTNGP11.phx.gbl...
When you get into code that you are actually considerring writing inline
assembler for because your C compiler generates slow code ... .NET is not
the right choice. these are specialized examples where speed is the only
concern ...

"HerrLucifer" <He************@yahoo.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Why? Then how is the world going to be all in .Net in future? Won't
microsoft solve this issue?

"Greg Young" <gr********@planetbeach.com> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
managed code would be the wrong answer for a challenge like writing

a chess
engine or doing heavy graphics work.

"HerrLucifer" <He************@yahoo.com> wrote in message
news:Op*************@TK2MSFTNGP11.phx.gbl...
> I am each day becoming more and more addicted to the new .Net
> framework because of its cool RAD facilities. However, performance

and
> speed is extremely important for my application development. I

have
> done many various tests to compare the performance speed of
> applications written in C++ 6.0 V.S. the same ones in VB.Net or
> VC#.Net . The result were quiet the same( i am not sure if i have

go
> the right path!). But I know C++ exe files use "KERNEL32.DLL"

directly
> while .Net exe files are first taken in by "MSCOREE.DLL", which in
> itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they

are
> executed.
>
> I need you expert guys out there help me more on this issue.
> eg: Is .Net really suitable for making 3D games? or such

applications
> which really
> consume CPUs.
> (Also, comparing applications load time, I think C++ ones are

always
> the winners)
>
> ---
> Best Regards
> Herr Lucifer
>
>
>
>
>



Jul 21 '05 #7

P: n/a
Alex Papadimoulis <al**********@pa3.14padimoulis.com> wrote:
I disagree. Unlike Java, .NET does not require a Virtual Machine to run.
.NET uses JIT Compilation -- you'll hardly notice a difference.


The CLR *is* a virtual machine, really. It's not like Java doesn't get
JIT compiled on pretty much every JVM these days.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #8

P: n/a
HerrLucifer <He************@yahoo.com> wrote:
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)


The problem with using managed code for games is garbage collection.
While in most apps it doesn't matter if you have a 0.05s pause (to
pluck a number from the air at random) every so often, games reviewers
would absolutely murder a game which did that.

Now, that may make it inappropriate for some games but not others - and
it *doesn't* make it inappropriate for other CPU-intensive
applications.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #9

P: n/a
guy
I may be wrong but I thought i heard that quake or doom (i am not into games) was rewritten in managed code as an experiment(!) and that it ran approx 90% the speed of the original.

guy

"HerrLucifer" wrote:
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)

---
Best Regards
Herr Lucifer


Jul 21 '05 #10

P: n/a
gc can have different implementations in any case - consider the server and
client versions already in existence

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
HerrLucifer <He************@yahoo.com> wrote:
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)


The problem with using managed code for games is garbage collection.
While in most apps it doesn't matter if you have a 0.05s pause (to
pluck a number from the air at random) every so often, games reviewers
would absolutely murder a game which did that.

Now, that may make it inappropriate for some games but not others - and
it *doesn't* make it inappropriate for other CPU-intensive
applications.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #11

P: n/a

"Jason" <mi*******@anywhere.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
gc can have different implementations in any case - consider the server
and
client versions already in existence


Certainly. And it would be nice to see a realtime type gc at some point. A
game would probably be easily written with a gc which can only execute when
called upon or is given time constraints. Its pretty much the same approach
as a realtime system would need. However, no such GC exists currently and
because of the fragile nature of a system running on such a runtime and
garabage collector, you are much less likely to retain the portability one
would want.
Jul 21 '05 #12

P: n/a
This is exactly what we do; we've got some really heavy number crunching in
old skool C++, and everything else (the UI and file IO) in managed C++. It
works well, as long as you're aware where you can get bottlenecks (and you
have a decent profiler).

Steve

"Andre Kaufmann" <an************@t-online.de> wrote in message
news:cb*************@news.t-online.com...
You can also have assembler code in managed c++ applications,
so called mixed executables.
Or you can have the code externally in native compiled Dlls, which
are called from managed code. E.g. the application written in
C# calling code written in managed C++ or native C++.

You´ll have the advantages from both worlds.
Rapid prototyping and fast code.

It´s also possible to have fast games written in managed c++
Have a look at the following article:

http://www.codeproject.com/managedcpp/quake2.asp

Andre


"Greg Young" <gr********@planetbeach.com> wrote in message

news:Oi**************@TK2MSFTNGP11.phx.gbl...
When you get into code that you are actually considerring writing inline
assembler for because your C compiler generates slow code ... .NET is not the right choice. these are specialized examples where speed is the only
concern ...

"HerrLucifer" <He************@yahoo.com> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
Why? Then how is the world going to be all in .Net in future? Won't
microsoft solve this issue?

"Greg Young" <gr********@planetbeach.com> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
> managed code would be the wrong answer for a challenge like writing
a chess
> engine or doing heavy graphics work.
>
> "HerrLucifer" <He************@yahoo.com> wrote in message
> news:Op*************@TK2MSFTNGP11.phx.gbl...
> > I am each day becoming more and more addicted to the new .Net
> > framework because of its cool RAD facilities. However, performance
and
> > speed is extremely important for my application development. I
have
> > done many various tests to compare the performance speed of
> > applications written in C++ 6.0 V.S. the same ones in VB.Net or
> > VC#.Net . The result were quiet the same( i am not sure if i have
go
> > the right path!). But I know C++ exe files use "KERNEL32.DLL"
directly
> > while .Net exe files are first taken in by "MSCOREE.DLL", which in
> > itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they
are
> > executed.
> >
> > I need you expert guys out there help me more on this issue.
> > eg: Is .Net really suitable for making 3D games? or such
applications
> > which really
> > consume CPUs.
> > (Also, comparing applications load time, I think C++ ones are
always
> > the winners)
> >
> > ---
> > Best Regards
> > Herr Lucifer
> >
> >
> >
> >
> >
>
>



Jul 21 '05 #13

P: n/a
http://www.codeproject.com/managedcpp/Quake2.asp
"guy" <gu*@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
I may be wrong but I thought i heard that quake or doom (i am not into games) was rewritten in managed code as an experiment(!) and that it ran
approx 90% the speed of the original.
guy

"HerrLucifer" wrote:
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)

---
Best Regards
Herr Lucifer


Jul 21 '05 #14

P: n/a
The System performance degrades alot when the VS.NET2005 is opened. BUt it has got a lot of cool appearance

"HerrLucifer" wrote:
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)

---
Best Regards
Herr Lucifer


Jul 21 '05 #15

P: n/a
This is not entirely true... There are 2 types of directX programming that can be done. DirectX retained mode and Intermediate mode. The C# directX sdk is based on the Intermediate mode programming and thus gives more high level control over the API. This also degrades performance compared to standard C++ applications running in DirectX Retained mode. Unless there is some heavy modification done to the CLR, C# will never be able to compare in speed to DirectX apps written in Retained mode...

"Alex Papadimoulis" wrote:
I disagree. Unlike Java, .NET does not require a Virtual Machine to run.
..NET uses JIT Compilation -- you'll hardly notice a difference.

Heavy graphics work can utilize DirectX in .NET using the DX SDK, which
would allow it to be as fast as C++.

--
Alex Papadimoulis
http://weblogs.asp.net/Alex_Papadimoulis
"Greg Young" <gr********@planetbeach.com> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
managed code would be the wrong answer for a challenge like writing a

chess
engine or doing heavy graphics work.

"HerrLucifer" <He************@yahoo.com> wrote in message
news:Op*************@TK2MSFTNGP11.phx.gbl...
I am each day becoming more and more addicted to the new .Net
framework because of its cool RAD facilities. However, performance and
speed is extremely important for my application development. I have
done many various tests to compare the performance speed of
applications written in C++ 6.0 V.S. the same ones in VB.Net or
VC#.Net . The result were quiet the same( i am not sure if i have go
the right path!). But I know C++ exe files use "KERNEL32.DLL" directly
while .Net exe files are first taken in by "MSCOREE.DLL", which in
itself depends on "KERNEL32.DLL and "ADVAPI32.DLL", and then they are
executed.

I need you expert guys out there help me more on this issue.
eg: Is .Net really suitable for making 3D games? or such applications
which really
consume CPUs.
(Also, comparing applications load time, I think C++ ones are always
the winners)

---
Best Regards
Herr Lucifer




Jul 21 '05 #16

P: n/a
"JNewman" <JN*****@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
This is not entirely true... There are 2 types of directX programming that can be done. DirectX

retained mode and Intermediate mode. The C# directX sdk is based on the Intermediate mode
programming and thus gives more high level control over the API. This also degrades performance
compared to standard C++ applications running in DirectX Retained mode. Unless there is some heavy
modification done to the CLR, C# will never be able to compare in speed to DirectX apps written in
Retained mode...

I think you have this the wrong way round. Retained mode was a set of Direct3D wrappers that run
slowly, but were easier to use for introductions to the API; Immediate mode meant actually using the
core API. However this is all very old stuff since Retained mode was reduced to an appendix in the
DX7 SDK 5 years ago and removed entirely with DX8. I admit I haven't used C# for D3D programming,
but are you sure it's using the higher-level-but-slower Retained mode? I'd be very surprised.

Andrew
Jul 21 '05 #17

P: n/a
Andrew McDonald wrote:
"JNewman" <JN*****@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...

This is not entirely true... There are 2 types of directX programming that can be done. DirectX


retained mode and Intermediate mode. The C# directX sdk is based on the Intermediate mode
programming and thus gives more high level control over the API. This also degrades performance
compared to standard C++ applications running in DirectX Retained mode. Unless there is some heavy
modification done to the CLR, C# will never be able to compare in speed to DirectX apps written in
Retained mode...

I think you have this the wrong way round. Retained mode was a set of Direct3D wrappers that run
slowly, but were easier to use for introductions to the API; Immediate mode meant actually using the
core API. However this is all very old stuff since Retained mode was reduced to an appendix in the
DX7 SDK 5 years ago and removed entirely with DX8. I admit I haven't used C# for D3D programming,
but are you sure it's using the higher-level-but-slower Retained mode? I'd be very surprised.

Andrew


I am quite new to C# and the whole .NET sceanario, but i currently have
the DirectX SDK and am using it for MDX. Im pretty sure its itermediate
mode, requires users to perform matrix manipulations manually etc. So
would this make it as fast as the C++ version?
Jul 21 '05 #18

P: n/a
"Oliver "aCiD2" Charles" <de************@gmail.com> wrote in
news:eD**************@TK2MSFTNGP09.phx.gbl...
...
I am quite new to C# and the whole .NET sceanario, but i currently have
the DirectX SDK and am using it for MDX. Im pretty sure its itermediate
mode, requires users to perform matrix manipulations manually etc. So
would this make it as fast as the C++ version?


First: Don't trust anyone but your own benchmark!
That said: managed code will get compiled to native code too, only later.
Why do you think it should run slower after that?
The only way to really make it faster would probably be to use
processor-specific SIMD instructions, but AFAIK you can't do that in C++
directly, either.

BTW: I'm not a game programmer, but I thought one of the major advances in
the last few years was that many matrix operations are done in the GPU now?
(T&L, Vertex Shaders...)

Niki
Jul 21 '05 #19

This discussion thread is closed

Replies have been disabled for this discussion.