472,127 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

Speed Test c# vs. c++

hi

i'm looking for a speed test of c# vs. c++.
the test should be representative for mass data production.
it should also include IO operations.

can anybody give me a good link from the internet?
thanx jazper.
Nov 16 '05 #1
6 10999
Hi Jazper,

Are you asking in terms of managed vs. unmanaged code? Also, C# vs. what
version of C++? C# and managed C++.NET both compile down to the same MSIL
code and execute in the CLR, so the speed test would be equal. (I'm not sure
if unmanaged C++.NET compiles down to IL though).

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

"Jazper Manto" <ej*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
| hi
|
| i'm looking for a speed test of c# vs. c++.
| the test should be representative for mass data production.
| it should also include IO operations.
|
| can anybody give me a good link from the internet?
| thanx jazper.
|
|
Nov 16 '05 #2
> Are you asking in terms of managed vs. unmanaged code? Also, C# vs. what
version of C++? C# and managed C++.NET both compile down to the same MSIL
code and execute in the CLR, so the speed test would be equal. (I'm not sure if unmanaged C++.NET compiles down to IL though).


nono, i meant C++ of VS 6.0.
i only found a link 2 minutes ago:
http://www.kuro5hin.org/print/2002/6/25/122237/078
however are there any better ones.
Nov 16 '05 #3
I found these links:

http://www.tommti-systems.de/go.html...enchmarks.html

http://www.osnews.com/story.php?news_id=5602&page=3

C++ 6.0 is usually faster than C#, but, speed is not the only consideration
of going with C# and .NET in general.

Check this out:
http://msdn.microsoft.com/library/de...eenccsharp.asp

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

"Jazper Manto" <ej*****@hotmail.com> wrote in message
news:O0*************@tk2msftngp13.phx.gbl...
|> Are you asking in terms of managed vs. unmanaged code? Also, C# vs. what
| > version of C++? C# and managed C++.NET both compile down to the same
MSIL
| > code and execute in the CLR, so the speed test would be equal. (I'm not
| sure
| > if unmanaged C++.NET compiles down to IL though).
|
| nono, i meant C++ of VS 6.0.
| i only found a link 2 minutes ago:
| http://www.kuro5hin.org/print/2002/6/25/122237/078
| however are there any better ones.
|
|
Nov 16 '05 #4
> C# and managed C++.NET both compile down to the same MSIL
Untrue? I was under the impression that MC++ can be faster than C# because
the C++ front-end performs many global & peephole optimizations that are not
in C# yet -- these get carried over to the generated CLR.

If there is much blocking I/O in your program (as you suggest) then you
probably won't notice much difference.

In my (unscientific) tests, C# came in at about 2x slower than C++ -- which
I consider to be fantastic.
IMHO, any reasonable (YMMV) slowdown is worth the price in dev-time and
safety.
(In contrast, Python was a few hundred times slower than C++ -- even then,
Python is pretty nice and I could have optimized away most of the
hot-spots.)

m
"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Jazper,

Are you asking in terms of managed vs. unmanaged code? Also, C# vs. what
version of C++? C# and managed C++.NET both compile down to the same MSIL
code and execute in the CLR, so the speed test would be equal. (I'm not sure if unmanaged C++.NET compiles down to IL though).

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

"Jazper Manto" <ej*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
| hi
|
| i'm looking for a speed test of c# vs. c++.
| the test should be representative for mass data production.
| it should also include IO operations.
|
| can anybody give me a good link from the internet?
| thanx jazper.
|
|

Nov 16 '05 #5
"Mike" <vi********@yahoo.com> wrote in message
news:e3***************@TK2MSFTNGP10.phx.gbl...
|> C# and managed C++.NET both compile down to the same MSIL
| Untrue? I was under the impression that MC++ can be faster than C# because
| the C++ front-end performs many global & peephole optimizations that are
not
| in C# yet -- these get carried over to the generated CLR.

I did some research on this. MC++ does compile down to MSIL. But, the C++
compiler in .NET can optimize the resulting IL [way] above and [way] beyond
what the C# compiler can do (poor little C# compiler... lol). The resulting
IL from MC++ is smaller and faster than the IL made by the C# compiler.
There are more switches for the C++ compiler than in the other compilers
(although, most of these are for unmanaged C++, they still *somehow* apply
to the MC++) which is why, IMHO, MC++ is faster than C#.

I think the biggest benefit of MC++ over C# is just that you can take your
existing C++ code, slap it into VS.NET and recompile it with the /clr switch
and it works. Now, obviously it's not a catch all, but 90% of the time, that
is the case.

| If there is much blocking I/O in your program (as you suggest) then you
| probably won't notice much difference.

True. :-)

| In my (unscientific) tests, C# came in at about 2x slower than C++ --
which
| I consider to be fantastic.
| IMHO, any reasonable (YMMV) slowdown is worth the price in dev-time and
| safety.
| (In contrast, Python was a few hundred times slower than C++ -- even then,
| Python is pretty nice and I could have optimized away most of the
| hot-spots.)

Yeah, while C# is slower (although, I haven't really noticed any of my C#
apps running all *that* slow), it is much, much safer than unmanaged C++ is,
especially in the hands of newbies ;-). I think there is a pretty good trade
off between C#'s safety and C++'s ability to do just about anything.

| m
|
|
| "Kyril Magnos" <ky**********@yahoo.com> wrote in message
| news:%2****************@TK2MSFTNGP12.phx.gbl...
| > Hi Jazper,
| >
| > Are you asking in terms of managed vs. unmanaged code? Also, C# vs. what
| > version of C++? C# and managed C++.NET both compile down to the same
MSIL
| > code and execute in the CLR, so the speed test would be equal. (I'm not
| sure
| > if unmanaged C++.NET compiles down to IL though).
| >
| > --
| > HTH
| >
| > Kyril Magnos
| > "I'm not a developer anymore, I'm a software engineer now!" :-)
| >
| > "Jazper Manto" <ej*****@hotmail.com> wrote in message
| > news:%2****************@TK2MSFTNGP11.phx.gbl...
| > | hi
| > |
| > | i'm looking for a speed test of c# vs. c++.
| > | the test should be representative for mass data production.
| > | it should also include IO operations.
| > |
| > | can anybody give me a good link from the internet?
| > | thanx jazper.
| > |
| > |
| >
| >
|
|
Nov 16 '05 #6
hi Kyril
I found these links:

http://www.tommti-systems.de/go.html...enchmarks.html

thank you. this one is really cool!
j.
Nov 16 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Yang Li Ke | last post: by
13 posts views Thread by Jordanakins | last post: by
2 posts views Thread by m004202002 | last post: by
29 posts views Thread by Bart Nessux | last post: by
2 posts views Thread by Dr. Peer Griebel | last post: by
6 posts views Thread by J. Campbell | last post: by
30 posts views Thread by Mike Cox | last post: by
6 posts views Thread by Dennis | last post: by
11 posts views Thread by Sezai YILMAZ | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.