473,706 Members | 7,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Speed Test c# vs. c++

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.
Nov 16 '05 #1
6 11142
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!" :-)

"Jazper Manto" <ej*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
| 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.
|
|
Nov 16 '05 #2
> 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).


nono, i meant C++ of VS 6.0.
i only found a link 2 minutes ago:
http://www.kuro5hin.org/print/2002/6/25/122237/078
however are there any better ones.
Nov 16 '05 #3
I found these links:

http://www.tommti-systems.de/go.html...enchmarks.html

http://www.osnews.com/story.php?news_id=5602&page=3

C++ 6.0 is usually faster than C#, but, speed is not the only consideration
of going with C# and .NET in general.

Check this out:
http://msdn.microsoft.com/library/de...eenccsharp.asp

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

"Jazper Manto" <ej*****@hotmai l.com> wrote in message
news:O0******** *****@tk2msftng p13.phx.gbl...
|> 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).
|
| nono, i meant C++ of VS 6.0.
| i only found a link 2 minutes ago:
| http://www.kuro5hin.org/print/2002/6/25/122237/078
| however are there any better ones.
|
|
Nov 16 '05 #4
> 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.

If there is much blocking I/O in your program (as you suggest) then you
probably won't notice much difference.

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

m
"Kyril Magnos" <ky**********@y ahoo.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
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!" :-)

"Jazper Manto" <ej*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
| 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.
|
|

Nov 16 '05 #5
"Mike" <vi********@yah oo.com> wrote in message
news:e3******** *******@TK2MSFT NGP10.phx.gbl.. .
|> 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
|
|
| "Kyril Magnos" <ky**********@y ahoo.com> wrote in message
| news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
| > 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!" :-)
| >
| > "Jazper Manto" <ej*****@hotmai l.com> wrote in message
| > news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
| > | 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.
| > |
| > |
| >
| >
|
|
Nov 16 '05 #6
hi Kyril
I found these links:

http://www.tommti-systems.de/go.html...enchmarks.html

thank you. this one is really cool!
j.
Nov 16 '05 #7

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

Similar topics

13
23062
by: Yang Li Ke | last post by:
Hi guys, Is it possible to know the internet speed of the visitors with php? Thanx -- Yang
13
7436
by: Jordanakins | last post by:
Usenet, I am currently working on my website and am needing to detect the connection speed of the client. I would like to do this in PHP and not use any other languages. This makes it a bit more complicated. I know it is possiable to do this in PHP but I can't think of how. All I need to figure out is if they are on dial up or not. It doesn't have to be 100% accurate but at least 50% accurate. Any help is greatly appreciated.
2
4096
by: m004202002 | last post by:
I recently visited a site http://us.mcafee.com/root/speedometer/default.asp which find out the connection speed . Can any body explain how(logic) to do it ? Can i do that using php ? Please help . Thank You .
29
3596
by: Bart Nessux | last post by:
Just fooling around this weekend. Wrote and timed programs in C, Perl and Python. Each Program counts to 1,000,000 and prints each number to the console as it counts. I was a bit surprised. I'm not an expert C or Perl programming expery, I'm most familiar with Python, but can use the others as well. Here are my results: C = 23 seconds Python = 26.5 seconds
2
1613
by: Dr. Peer Griebel | last post by:
Hi, I have a class with some properties. I would like to verify that only valid values are assigned to the properties using assert. Therefore I code setters and getters and use property() to convert these to have a real property. Since the verification is only performed in __debug__ runs the property() is quite a lot of overhead. I tried to circumvent it. This is my result so far:
6
6873
by: J. Campbell | last post by:
Hi everyone. I'm sure that this is common knowledge for many/most here. However, it was rather illuminating for me (someone learning c++) and I thought it might be helpful for someone else. I'm sure I'll get scolded for an OT post, but I think issues of this type should be of interest to programmers until they get a handle on them. I was reading some old threads about the relative advantages of using ++i vs i++ (I won't rehash the many...
30
2804
by: Mike Cox | last post by:
Hi. I recently ran a benchmark against two simple programs, one written in Java and the other in C++. The both accomplish the same thing, outputting "Hello World" on my screen. The C++ program took .5 seconds to complete on my 400 Mhz PC while the Java program took 6.5 seconds. I am running the SUSE 8.2 Linux distribution. Why is Java that much slower than the C++ program? I read on Slashdot that Java was almost as fast as C++. ...
6
2779
by: Dennis | last post by:
I was trying to determine the fastest way to build a byte array from components where the size of the individual components varied depending on the user's input. I tried three classes I built: (1) using redim arrays to add to a normal byte array (2) using an ArrayList and finally (3) using a memorystream. These three classes are listed below the test sub called "TestBuildByteArray". It was interesting that using the memorystream was...
11
9212
by: Sezai YILMAZ | last post by:
Hello I need high throughput while inserting into PostgreSQL. Because of that I did some PostgreSQL insert performance tests. ------------------------------------------------------------ -- Test schema create table logs ( logid serial primary key, ctime integer not null,
3
3591
by: Chris288 | last post by:
Hi, I have a problem where our app when compiled in VS2005 runs about 50% the speed it attains in VS2003. This is an unmanaged C++ app. I have tried most combinations of the optimization and language settings with little change in run speed. I compared the generated native code in various places in the code and noticed two things.
0
8693
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
9281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7899
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6613
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
5935
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
4707
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2497
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.