473,748 Members | 8,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is C# 450% slower than C++ on nested loops ??

http://www.tommti-systems.de/go.html...enchmarks.html
The above link shows that C# is 450% slower on something as simple as a nested
loop. Is this because .NET is inherently slower or does the C# compiler merely
produce code that is not as well optimized as the C++ compiler?
Dec 28 '05 #1
77 5231
For those that would like more information on why this question is being
asked, see the following link:

http://groups.google.com/group/micro...cc573d00467eec

A good amount of the reply, and the OPs misunderstandin g of the nature
of .NET and the CLR is in this thread.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Peter Olcott" <ol****@att.net > wrote in message
news:l_Asf.3805 9$QW2.19657@duk eread08...

http://www.tommti-systems.de/go.html...enchmarks.html
The above link shows that C# is 450% slower on something as simple as a
nested loop. Is this because .NET is inherently slower or does the C#
compiler merely produce code that is not as well optimized as the C++
compiler?

Dec 28 '05 #2
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:em******** *********@tk2ms ftngp13.phx.gbl ...
For those that would like more information on why this question is being
asked, see the following link:

http://groups.google.com/group/micro...cc573d00467eec
So then it seems that your contention (based on the message that the link points
to) is that the whole difference is because of poorer code generation by the C#
compiler.

A good amount of the reply, and the OPs misunderstandin g of the nature of
.NET and the CLR is in this thread.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Peter Olcott" <ol****@att.net > wrote in message
news:l_Asf.3805 9$QW2.19657@duk eread08...

http://www.tommti-systems.de/go.html...enchmarks.html
The above link shows that C# is 450% slower on something as simple as a
nested loop. Is this because .NET is inherently slower or does the C#
compiler merely produce code that is not as well optimized as the C++
compiler?


Dec 28 '05 #3
Not at all. I never said .NET was slower than C++ code, nor did I say
that if it was slower, it was because C# compiles in a more inefficent
manner.

The thing you don't get is that IL runs through the CLR, which
transforms it into native code that is then run. End of story. Until you
accept that, none of the benchmarks or claims that you make will be valid.
Especially if you don't post the code in question which you claim is:

- 100 lines
- patent pending
- part of a system which is worth millions of dollars

You seem to have a history of long, intentionally confrontational posts
and we don't need another one.

Now I'm really done feeding the troll.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Peter Olcott" <ol****@att.net > wrote in message
news:BzBsf.3806 4$QW2.15791@duk eread08...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in message news:em******** *********@tk2ms ftngp13.phx.gbl ...
For those that would like more information on why this question is
being asked, see the following link:

http://groups.google.com/group/micro...cc573d00467eec


So then it seems that your contention (based on the message that the link
points to) is that the whole difference is because of poorer code
generation by the C# compiler.

A good amount of the reply, and the OPs misunderstandin g of the nature
of .NET and the CLR is in this thread.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Peter Olcott" <ol****@att.net > wrote in message
news:l_Asf.3805 9$QW2.19657@duk eread08...

http://www.tommti-systems.de/go.html...enchmarks.html
The above link shows that C# is 450% slower on something as simple as a
nested loop. Is this because .NET is inherently slower or does the C#
compiler merely produce code that is not as well optimized as the C++
compiler?



Dec 28 '05 #4
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
news:eF******** *****@TK2MSFTNG P15.phx.gbl:
- part of a system which is worth millions of dollars


The part I don't get is that the money-men are going to let a little thing
like "must be written in .NET" get between them and their millions. :)

-mdb
Dec 28 '05 #5
Michael,

I guess that's why I don't have millions of dollars already! =)
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Michael Bray" <mbray@makeDInt oDot_ctiusaDcom > wrote in message
news:Xn******** *************** *****@207.46.24 8.16...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote
in
news:eF******** *****@TK2MSFTNG P15.phx.gbl:
- part of a system which is worth millions of dollars


The part I don't get is that the money-men are going to let a little thing
like "must be written in .NET" get between them and their millions. :)

-mdb

Dec 28 '05 #6
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> a écrit
dans le message de news: eF************* **@TK2MSFTNGP15 .phx.gbl...

| Now I'm really done feeding the troll.

Heh, you ought to come and see what we have had to deal with in our non-tech
group :-))

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Dec 28 '05 #7

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:eF******** *******@TK2MSFT NGP15.phx.gbl.. .
Not at all. I never said .NET was slower than C++ code, nor did I say that
if it was slower, it was because C# compiles in a more inefficent manner.
If you look at what I said, you will see that you just agreed with what I said.

The thing you don't get is that IL runs through the CLR, which transforms
it into native code that is then run. End of story. Until you accept that,
none of the benchmarks or claims that you make will be valid. Especially if
you don't post the code in question which you claim is:

- 100 lines
- patent pending
- part of a system which is worth millions of dollars

You seem to have a history of long, intentionally confrontational posts and
we don't need another one.

Now I'm really done feeding the troll.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Peter Olcott" <ol****@att.net > wrote in message
news:BzBsf.3806 4$QW2.15791@duk eread08...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:em******** *********@tk2ms ftngp13.phx.gbl ...
For those that would like more information on why this question is being
asked, see the following link:

http://groups.google.com/group/micro...cc573d00467eec


So then it seems that your contention (based on the message that the link
points to) is that the whole difference is because of poorer code generation
by the C# compiler.

A good amount of the reply, and the OPs misunderstandin g of the nature of
.NET and the CLR is in this thread.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Peter Olcott" <ol****@att.net > wrote in message
news:l_Asf.3805 9$QW2.19657@duk eread08...

http://www.tommti-systems.de/go.html...enchmarks.html
The above link shows that C# is 450% slower on something as simple as a
nested loop. Is this because .NET is inherently slower or does the C#
compiler merely produce code that is not as well optimized as the C++
compiler?



Dec 28 '05 #8

"Michael Bray" <mbray@makeDInt oDot_ctiusaDcom > wrote in message
news:Xn******** *************** *****@207.46.24 8.16...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
news:eF******** *****@TK2MSFTNG P15.phx.gbl:
- part of a system which is worth millions of dollars

The part I don't get is that the money-men are going to let a little thing
like "must be written in .NET" get between them and their millions. :)


If it can be written in .NET without any loss of speed it might have greater
value. It would seem to me that non managed code will be eventually phased out,
at least on the MS Windows platform.

-mdb

Dec 28 '05 #9
Joanna,

Which one, alt.inventors? That's a non-tech group I saw...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Joanna Carter [TeamB]" <jo****@not.for .spam> wrote in message
news:%2******** ************@TK 2MSFTNGP12.phx. gbl...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> a écrit
dans le message de news: eF************* **@TK2MSFTNGP15 .phx.gbl...

| Now I'm really done feeding the troll.

Heh, you ought to come and see what we have had to deal with in our
non-tech
group :-))

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Dec 28 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
9930
by: Neptune | last post by:
Hello. I am working my way through Zhang's "Teach yourself C in 24 hrs (2e)" (Sam's series), and for nested loops, he writes (p116) "It's often necessary to create a loop even when you are already in a loop." Then he goes on to portray a contrived example that doesn't tell me under what conditions a nested loop might be favoured as a solution? i.e. what are nested loops useful for? What kinds of algorithms are served by nested loops?...
17
3034
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html Why is C# 500% slower than C++ on Nested Loops ??? Will this problem be solved in the future???
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.