C# vs. Unmanaged C++
-
Does anyone have any resources or benchmarks on execution speed of C# and unmanaged C++ code? I'm primarily interested in intensive mathmatical algorithms. My gut feeling tells me that unmanaged code should be faster because it lacks the intermediate languages and compilers that are involved with C# (or the .NET framework in general). However, I did find this interesting benchmark that I find a little hard to believe. But who knows? http://www.devhood.com/tutorials/tutorial\_details.aspx?tutorial\_id=203&printer=t
-
Does anyone have any resources or benchmarks on execution speed of C# and unmanaged C++ code? I'm primarily interested in intensive mathmatical algorithms. My gut feeling tells me that unmanaged code should be faster because it lacks the intermediate languages and compilers that are involved with C# (or the .NET framework in general). However, I did find this interesting benchmark that I find a little hard to believe. But who knows? http://www.devhood.com/tutorials/tutorial\_details.aspx?tutorial\_id=203&printer=t
It's not a fair comparison to compare C# with unmanaged C++. Or do you actually mean managed C++? Nish
Oh, I don't know why she's leaving, or where she's gonna go I guess she's got her reasons but I just don't wanna know 'Cos for 24 years I've been living next door to Alice 24 years just waitin' for a chance To tell her how I feel and maybe get a second glance Now I gotta get used to not living next door to Alice
-
It's not a fair comparison to compare C# with unmanaged C++. Or do you actually mean managed C++? Nish
Oh, I don't know why she's leaving, or where she's gonna go I guess she's got her reasons but I just don't wanna know 'Cos for 24 years I've been living next door to Alice 24 years just waitin' for a chance To tell her how I feel and maybe get a second glance Now I gotta get used to not living next door to Alice
I'm not sure I understand what you mean by not being "fair" to compare the two. I'm interested in knowing if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). Or am I going to take a perfomance hit by switching to .NET and managed code. I mean, I know it's not "fair" to compare a Honda Civic EX to a Ferrari 360 Modena, but I sure know which one is faster. That's all I want to know.
-
I'm not sure I understand what you mean by not being "fair" to compare the two. I'm interested in knowing if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). Or am I going to take a perfomance hit by switching to .NET and managed code. I mean, I know it's not "fair" to compare a Honda Civic EX to a Ferrari 360 Modena, but I sure know which one is faster. That's all I want to know.
Well then here goes :- Unmanaged code will always run faster than managed code. Thus unmanaged C++ will be faster than C# or any other .NET language including managed C++. Among the managed languages, managed C++ produces slightly faster code cause the MC++ compiler has certain extra optimizations [I do not know the details, but I've heard Chris M rave about this several times] Nish
Oh, I don't know why she's leaving, or where she's gonna go I guess she's got her reasons but I just don't wanna know 'Cos for 24 years I've been living next door to Alice 24 years just waitin' for a chance To tell her how I feel and maybe get a second glance Now I gotta get used to not living next door to Alice
-
I'm not sure I understand what you mean by not being "fair" to compare the two. I'm interested in knowing if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). Or am I going to take a perfomance hit by switching to .NET and managed code. I mean, I know it's not "fair" to compare a Honda Civic EX to a Ferrari 360 Modena, but I sure know which one is faster. That's all I want to know.
gt4924f wrote: if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). No! C# was designed to be "easy to use", not to be fast. If you want to do some math calculations, pick either C++ (maybe with Blitz library) or Fortran. Everything else is too slow IMHO. I vote pro drink :beer:
-
gt4924f wrote: if C# truly does combine the benefits of C++ (speed, flexibility) with the benefits of a RAD language (ease of use). No! C# was designed to be "easy to use", not to be fast. If you want to do some math calculations, pick either C++ (maybe with Blitz library) or Fortran. Everything else is too slow IMHO. I vote pro drink :beer:
Nemanja Trifunovic wrote: C# was designed to be "easy to use", not to be fast Exactly. In fact most of .NET seems to be like that :-) Nish
Oh, I don't know why she's leaving, or where she's gonna go I guess she's got her reasons but I just don't wanna know 'Cos for 24 years I've been living next door to Alice 24 years just waitin' for a chance To tell her how I feel and maybe get a second glance Now I gotta get used to not living next door to Alice