|> 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
|
|
| | > 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!"

| >
| > | > | 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.
| > |
| > |
| >
| >
|
|