C# vs. C++ performance [modified] (Contest)
-
Hey, GCC is not so bad! ;P I need some penguin right now! ;P
Super Lloyd wrote:
Hey, GCC is not so bad!
Nope, it's only slower than C#, that is a great selling point! :laugh:
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Super Lloyd wrote:
C++ 10000 Milliseconds = 1313
change to 562 Intel 8.0 and MSVC 6.0 You are running twice the time of "last generation's technology." :) shall I load up Intel 9.0 on another machine and make the difference greater? -- modified at 11:47 Tuesday 1st August, 2006
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Jeffry J. Brickley wrote:
change to 562 Intel 8.0 and MSVC 6.0
Wrong! You should test both program on your computer! because my computer is probably much slower than yours! otherwise you compare my C# version on my PC to you C++ version on your PC. well, all the C++ coder seems afraid to see the truth I could see... ;P
-
I tried to make a C++ project with VS... Obviously I'm not used to.. It doesn't recognize 'vector' :sigh: could anyone do the test? :sigh: (otherwise I could believe you are afraid to see C++ be beaten)
Super Lloyd wrote:
(otherwise I could believe you are afraid to see C++ be beaten)
I already did.... look down.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Super Lloyd wrote:
C++ 10000 Milliseconds = 1313
change to 562 Intel 8.0 and MSVC 6.0 You are running twice the time of "last generation's technology." :) shall I load up Intel 9.0 on another machine and make the difference greater? -- modified at 11:47 Tuesday 1st August, 2006
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
In case you don't know how to compile C# let's at least compare the computer's spec. I have and AMD Semprom 2800+ 1.61 GHz
-
Jeffry J. Brickley wrote:
change to 562 Intel 8.0 and MSVC 6.0
Wrong! You should test both program on your computer! because my computer is probably much slower than yours! otherwise you compare my C# version on my PC to you C++ version on your PC. well, all the C++ coder seems afraid to see the truth I could see... ;P
Super Lloyd wrote:
well, all the C++ coder seems afraid to see the truth I could see...
Not all of us have C# on every machine.... but it was on a 3.0ghz Intel P4. what machine was yours on?
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Super Lloyd wrote:
C++ 10000 Milliseconds = 1313
change to 562 Intel 8.0 and MSVC 6.0 You are running twice the time of "last generation's technology." :) shall I load up Intel 9.0 on another machine and make the difference greater? -- modified at 11:47 Tuesday 1st August, 2006
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Or he could have a slower PC than you.... ;)
Steve Maier, MCSD MCAD MCTS
-
On another thread some posted this link: http://www.csharphelp.com/archives2/archive458.html[^] Now I was very suprised by this bad C# result, it's not at all what I experience! So I decided to test my self! I have .NET 2 and gcc 3.4.4 I compiled like this: CPP> gcc -O3 -o sieve2.exe sieve.cpp -lstdc++ C#> csc /o+ /nologo /out:sieve.exe Sieve.cs I got: C# 10000 Milliseconds = 1156 C++ 10000 Milliseconds = 1313 Haheum..... what else can I say? -- modified at 11:18 Tuesday 1st August, 2006 I propose a Contest. Post a small C++ performance test program here (less than 200 readable lines). I'll try to beat it with a C# version!
on my machine C# (VS05) : 812 C++ (VC6) : 578 C++ (VS03) : 609 the C++ app won't run on VS05. out of range error in one of the vector iterator hits. default release build settings, for each -- modified at 12:04 Tuesday 1st August, 2006
Why donchoo take a peekchur mayn? OK, cleeeeek
-
Super Lloyd wrote:
well, all the C++ coder seems afraid to see the truth I could see...
Not all of us have C# on every machine.... but it was on a 3.0ghz Intel P4. what machine was yours on?
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
AMD Sempron 2800+ 1.61 GHz No wonder you are twice as fast!
-
on my machine C# (VS05) : 812 C++ (VC6) : 578 C++ (VS03) : 609 the C++ app won't run on VS05. out of range error in one of the vector iterator hits. default release build settings, for each -- modified at 12:04 Tuesday 1st August, 2006
Why donchoo take a peekchur mayn? OK, cleeeeek
Ha... good! okay.....
-
on my machine C# (VS05) : 812 C++ (VC6) : 578 C++ (VS03) : 609 the C++ app won't run on VS05. out of range error in one of the vector iterator hits. default release build settings, for each -- modified at 12:04 Tuesday 1st August, 2006
Why donchoo take a peekchur mayn? OK, cleeeeek
Is it .NET2?? .NET2 is much better than .NET1 !
-
On another thread some posted this link: http://www.csharphelp.com/archives2/archive458.html[^] Now I was very suprised by this bad C# result, it's not at all what I experience! So I decided to test my self! I have .NET 2 and gcc 3.4.4 I compiled like this: CPP> gcc -O3 -o sieve2.exe sieve.cpp -lstdc++ C#> csc /o+ /nologo /out:sieve.exe Sieve.cs I got: C# 10000 Milliseconds = 1156 C++ 10000 Milliseconds = 1313 Haheum..... what else can I say? -- modified at 11:18 Tuesday 1st August, 2006 I propose a Contest. Post a small C++ performance test program here (less than 200 readable lines). I'll try to beat it with a C# version!
-
Is it .NET2?? .NET2 is much better than .NET1 !
-
Good!
-
Alright, you won! ;)
-
AMD Sempron 2800+ 1.61 GHz No wonder you are twice as fast!
Super Lloyd wrote:
No wonder you are twice as fast!
grumble grumble growl... you made me pull out my 7.2 .net on the laptop, compile, move the application over and run... ;P 1000ms C# 562 Intel C++ Satisfied yet? yes, I moved to release on both, yes, using optimized on both rather than YOUR optimized on one and non on the other....
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Super Lloyd wrote:
No wonder you are twice as fast!
grumble grumble growl... you made me pull out my 7.2 .net on the laptop, compile, move the application over and run... ;P 1000ms C# 562 Intel C++ Satisfied yet? yes, I moved to release on both, yes, using optimized on both rather than YOUR optimized on one and non on the other....
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Hey, I did optimize both! didn't you see the -O3 ?! Well the result are... well.... I didn't know gcc was that bad!.... :omg: That make me rethink about life! :laugh:
-
On another thread some posted this link: http://www.csharphelp.com/archives2/archive458.html[^] Now I was very suprised by this bad C# result, it's not at all what I experience! So I decided to test my self! I have .NET 2 and gcc 3.4.4 I compiled like this: CPP> gcc -O3 -o sieve2.exe sieve.cpp -lstdc++ C#> csc /o+ /nologo /out:sieve.exe Sieve.cs I got: C# 10000 Milliseconds = 1156 C++ 10000 Milliseconds = 1313 Haheum..... what else can I say? -- modified at 11:18 Tuesday 1st August, 2006 I propose a Contest. Post a small C++ performance test program here (less than 200 readable lines). I'll try to beat it with a C# version!
Super Lloyd wrote:
I propose a Contest. Post a small C++ performance test program here (less than 200 readable lines). I'll try to beat it with a C# version!
From the top of my head:
#include <iostream>
using namespace std;int main()
{
double sum = 0.;
for (unsigned i = 0; i < 0xffffffU; ++i) {
char buffer[1024];
for (int j = 0; j < 1024; ++j)
sum += buffer[j];
}
cout << sum;
}-- modified at 12:20 Tuesday 1st August, 2006
-
AMD Sempron 2800+ 1.61 GHz No wonder you are twice as fast!
Super Lloyd wrote:
AMD Sempron 2800+ 1.61 GHz No wonder you are twice as fast!
I just looked at your specs... you realize that the 2800+ is the relative performance compared to an Intel right? My AMD is only 1.8ghz and runs faster than this one at work. I don't have any of my fast computers at the moment. :)
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
I tried cl /O2 /EHsc sieve.cpp It compiled without any message but crashed right away... Now, if C++ is so much more powerfull, why do I need an optimized compiler? :doh:
Super Lloyd wrote:
Now, if C++ is so much more powerfull, why do I need an optimized compiler?
You obviously have no clue as to the difference between what a compiler is and what a language is.
Jeremy Falcon
-
On another thread some posted this link: http://www.csharphelp.com/archives2/archive458.html[^] Now I was very suprised by this bad C# result, it's not at all what I experience! So I decided to test my self! I have .NET 2 and gcc 3.4.4 I compiled like this: CPP> gcc -O3 -o sieve2.exe sieve.cpp -lstdc++ C#> csc /o+ /nologo /out:sieve.exe Sieve.cs I got: C# 10000 Milliseconds = 1156 C++ 10000 Milliseconds = 1313 Haheum..... what else can I say? -- modified at 11:18 Tuesday 1st August, 2006 I propose a Contest. Post a small C++ performance test program here (less than 200 readable lines). I'll try to beat it with a C# version!