.NET 4 Rocks!
-
I agree with Mr O'Hanlon; Lets see a code samples. ;)
Simon
Exactly what I thought... it is the beginning of a flame war... Anyway, managed code is inherently slower than unmanaged. You got other benefits, like platform indipendence and so on... Too tired to present an example, but I suspect serialisation would be an excellent candidate.
-
never underestimate the powers of pure C++ ... in general 40 to 50 % faster than any runtime.
You're right as long as MFC stays away from us.
-
You make a statement like that, you've got to be able to prove it. Go on, back it up.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
never underestimate the powers of pure C++ ... in general 40 to 50 % faster than any runtime.
In a lot of usages, pure speed is not the only deciding factor. Assuming your ascertation is more than simple hypothesis, let us consider for one moment the advantages of ‘slower’ managed code. 0. Memory is, on the whole, MANAGED for you. Thus the reliance on the coder getting it right is removed. BIG bonus time. 1. Development time is, I am sorry to say, quicker using C# [for example] than C++ 2. Developers are cheaper for modern managed languages over older unmanaged platforms. So, from these simple three points you can see why managed not-det environment is preferred. The customer – that’s the guy paying for the work – get’s more bangs for their buck and doesn’t notice that the response is 200ms against 120ms. To clarify my position, we use TCL scripting, C#, C++ and Java all in one huge big mofu application. Depending on what is being done, different tools are chosen for different jobs. For desktop UI, C# rocks. For processing 10 kt/m C++ is great. For site modifiable interactions and configuration TCL is the Daddy. To keep the Hippies happy Java is the way man.
Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H
-
never underestimate the powers of pure C++ ... in general 40 to 50 % faster than any runtime.
Granted, 'managed' means some additional overhead which good old C or C++ avoid. But 40 - 50 %? First you must take a look at your program and identify the parts where the CPU is really put to work. And already 90% or more of your code have become totally uninteresting. After identifying the critical parts of your program, you need to take a good look at your algorithms at those locations. A poorly chosen algorithm can kill the performance, totally independent of the programming language, the optimizations the compiler may perform or the capabilities of the actual hardware. In C++ it has become unusual to optimize the code for a certain hardware. Nowadays there are just too many different CPUs, so you can't really know what awaits your program at runtime. Managed applications may actually have an advantage here since they are compiled just before execution. So where is this guaranteed performance boost in C++ supposed to come from? P.S: I still like working in C++ and also have done a bit of optimizing there, but I simply don't see that vast advantage in performance. You have to work hard to get it and with similar treatment a managed language may produce similar results.
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'. I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
-
never underestimate the powers of pure C++ ... in general 40 to 50 % faster than any runtime.
-
Not really no - it goes part of the way, but I'd like to see it with .NET 4 which is much better performing than 3.5 due to the leaner client framework. Certainly, on Windows the difference between C# and Visual C++ is nowhere near the 40-50% difference claimed by the OP.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
Thanks, very interesting data. On Windows "C++ is %15.8 faster than .Net" On Linux "C++ is 22.% faster than Java" [Remember these are benchmarks over very specific high CPU usage problem sets. These are not general statements] Not quite the 40-50% originally said, but certainly interesting none the less. I'd be really interested to see the same tests repeated with .net 4.
Simon
-
Exactly what I thought... it is the beginning of a flame war... Anyway, managed code is inherently slower than unmanaged. You got other benefits, like platform indipendence and so on... Too tired to present an example, but I suspect serialisation would be an excellent candidate.
federico.strati wrote:
Exactly what I thought... it is the beginning of a flame war...
No, it's not. You made an unsubstantiated comment - I'd be more inclined to listen if you actually backed it up rather than making a random statement and then run off when challenged to provide proof. Don't present anecdotal evidence - be empirical. I just get sick and tired of language zealots claiming that language A is better in than language B without offering any qualifying evidence.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
-
The test should be done against .NET4, which is way faster than .NET3, whereas C++ is only a little bit faster than .NET3! ;)
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.
-
federico.strati wrote:
Exactly what I thought... it is the beginning of a flame war...
No, it's not. You made an unsubstantiated comment - I'd be more inclined to listen if you actually backed it up rather than making a random statement and then run off when challenged to provide proof. Don't present anecdotal evidence - be empirical. I just get sick and tired of language zealots claiming that language A is better in than language B without offering any qualifying evidence.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
Pete O'Hanlon wrote:
I just get sick and tired of language zealots claiming that
0
is better in than1
without offering any qualifying evidenceftfy
Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H
-
Not really no - it goes part of the way, but I'd like to see it with .NET 4 which is much better performing than 3.5 due to the leaner client framework. Certainly, on Windows the difference between C# and Visual C++ is nowhere near the 40-50% difference claimed by the OP.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
It's interesting that Mono appears to be quicker than .NET - 3.5 at least.
-
Exactly what I thought... it is the beginning of a flame war... Anyway, managed code is inherently slower than unmanaged. You got other benefits, like platform indipendence and so on... Too tired to present an example, but I suspect serialisation would be an excellent candidate.
federico.strati wrote:
Anyway, managed code is inherently slower than unmanaged.
Depends. If the code is doing a large amount of memory allocation and deallocation, managed can be faster because it can leave the deallocation until later, whereas the unmanaged does it right away.
-
In a lot of usages, pure speed is not the only deciding factor. Assuming your ascertation is more than simple hypothesis, let us consider for one moment the advantages of ‘slower’ managed code. 0. Memory is, on the whole, MANAGED for you. Thus the reliance on the coder getting it right is removed. BIG bonus time. 1. Development time is, I am sorry to say, quicker using C# [for example] than C++ 2. Developers are cheaper for modern managed languages over older unmanaged platforms. So, from these simple three points you can see why managed not-det environment is preferred. The customer – that’s the guy paying for the work – get’s more bangs for their buck and doesn’t notice that the response is 200ms against 120ms. To clarify my position, we use TCL scripting, C#, C++ and Java all in one huge big mofu application. Depending on what is being done, different tools are chosen for different jobs. For desktop UI, C# rocks. For processing 10 kt/m C++ is great. For site modifiable interactions and configuration TCL is the Daddy. To keep the Hippies happy Java is the way man.
Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H
Nagy Vilmos wrote:
0. Memory is, on the whole, MANAGED for you. Thus the reliance on the coder getting it right is removed. BIG bonus time.
there are enough smart ptr / container classes out there that no C++ programmer should have to worry about explicit memory management, if he/she doesn't want to.
Nagy Vilmos wrote:
1. Development time is, I am sorry to say, quicker using C# [for example] than C++
only because the .Net framework has so much built-in. as a language, C# isn't a great improvement. and with each new version it becomes more and more obtuse. and yes, you can avoid things like LINQ and anonymous delegates and nullable variables, but you can also avoid the ugly parts of C++.
Nagy Vilmos wrote:
2. Developers are cheaper for modern managed languages over older unmanaged platforms.
not if you want the job done correctly.
-
Pete O'Hanlon wrote:
I just get sick and tired of language zealots claiming that
0
is better in than1
without offering any qualifying evidenceftfy
Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H
Exactly! 1 is much better than 0.
-
Exactly what I thought... it is the beginning of a flame war... Anyway, managed code is inherently slower than unmanaged. You got other benefits, like platform indipendence and so on... Too tired to present an example, but I suspect serialisation would be an excellent candidate.
federico.strati wrote:
Anyway, managed code is inherently slower than unmanaged. You got other benefits, like platform indipendence and so on...
Look, these kinds of statement are almost meaningless. The overarching strategy is to consider the nature of your business problem and then choose the appropriate tool(s) for the problem(s) at hand. Raw execution speed is just one criterion. Also factors such as ease of design and expressiveness can enable performance improvements over closer-to-the-metal languages. I remember being told at one interview that a port of their app. from C++ to C# increased app. performance. I also know of a case study with Eiffel (a "managed" language) where a port from C to Eiffel resulted in way greater performance due to ease of design and expressiveness.
Kevin
-
Nagy Vilmos wrote:
0. Memory is, on the whole, MANAGED for you. Thus the reliance on the coder getting it right is removed. BIG bonus time.
there are enough smart ptr / container classes out there that no C++ programmer should have to worry about explicit memory management, if he/she doesn't want to.
Nagy Vilmos wrote:
1. Development time is, I am sorry to say, quicker using C# [for example] than C++
only because the .Net framework has so much built-in. as a language, C# isn't a great improvement. and with each new version it becomes more and more obtuse. and yes, you can avoid things like LINQ and anonymous delegates and nullable variables, but you can also avoid the ugly parts of C++.
Nagy Vilmos wrote:
2. Developers are cheaper for modern managed languages over older unmanaged platforms.
not if you want the job done correctly.
Chris Losinger wrote:
not if you want the job done correctly.
I've worked in both C++ and .NET and I've not seen any greater dev ability in C++ compared to C#. I agree that C++ done well is fine but my experience was that most actual C++ was a mishmash of sloppy low-level C techniques combined with occasional high-level abstractions. Given that reality I much prefer being in the .NET environment.
Chris Losinger wrote:
you can avoid things like LINQ and anonymous delegates and nullable variables
Actually, these features enable more concise and more expressive code.
Kevin
-
You make a statement like that, you've got to be able to prove it. Go on, back it up.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
He's new, and obviously isn't aware that anything he says will need facts in order to establish an acceptable amount of veracity.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
Chris Losinger wrote:
not if you want the job done correctly.
I've worked in both C++ and .NET and I've not seen any greater dev ability in C++ compared to C#. I agree that C++ done well is fine but my experience was that most actual C++ was a mishmash of sloppy low-level C techniques combined with occasional high-level abstractions. Given that reality I much prefer being in the .NET environment.
Chris Losinger wrote:
you can avoid things like LINQ and anonymous delegates and nullable variables
Actually, these features enable more concise and more expressive code.
Kevin
Kevin McFarlane wrote:
I've worked in both C++ and .NET and I've not seen any greater dev ability in C++ compared to C#.
true; i don't think C++ development is necessarily better or faster. but i know i find myself wishing C# had some of C++'s features (and vice versa) whenever i switch from one to the other. the .Net framework is undeniably a wonderful toolbox, though. that's what makes C# seem more efficient, IMO. it's not that C#'s language constructs are all that great, it's that all the utility classes are right there.
Kevin McFarlane wrote:
Actually, these features enable more concise and more expressive code.
maybe, but they are ugly and cryptic - attributes C++ haters like to use against it.