473,385 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C# vs C++ on socke sending/rec speed?

Hi All

Has anyone done any experiment on comparison between C++ and C# on socket rec/send speed

Conditions
in Windows system, same CPU for senders or receivers. Can you see how much faster a C++ app can send/rec messages than a C# app
I am working on some real time apps with heave traffic. I am not sure whether .NET can handle it at all
Thanks a lo

Chri
Nov 16 '05 #1
2 2039
chrisben <an*******@discussions.microsoft.com> wrote:
Has anyone done any experiment on comparison between C++ and C# on
socket rec/send speed?

Conditions:
in Windows system, same CPU for senders or receivers. Can you see how
much faster a C++ app can send/rec messages than a C# app? I am
working on some real time apps with heave traffic. I am not sure
whether .NET can handle it at all.


While I haven't tested it, I'd imagine you'd have to have a *very* fast
network connection and a pretty slow CPU for the speed of the computers
(and the programs they're running) to be the gating factor.

How heavy is heavy traffic in this case?

When writing "real time" apps with .NET, the main thing to worry about
is the garbage collector, I believe, rather than the speed of .NET code
itself.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
chrisben <an*******@discussions.microsoft.com> wrote:
Thanks Jon. In my situation, the sender is a C++ app, the speed could
be upto 140 Mbits/sec based on my bandwidth monitor. Since we have
multiple clients, the C# client side should not be so high. I have
seen 4MByte/sec on the client side and it could be doubled. THe
problem is that we are dropping msgs.
What's the system architecture like? If you're using TCP/IP, you
shouldn't be dropping anything...
And I do not know whether the
prob is on sender side or receiver side. And I do not know whether we
can have higher traffic int eh future. In term of hardware, we
haveGigBit switch and ~4 Ghz dual CPU, with hyperthreading.
I wouldn't have thought .NET would have much problem on that front.
For GC, since it should be handled by the envrionment itself, what
should I pay attention on the coding side?


Try not to create many objects unnecessarily, and particularly try not
to regularly create objects which will be long-lived. You should
probably use a profiler to check how much time is being spent in GC of
which generation etc, to see whether or not that's causing a problem.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3

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

Similar topics

8
by: Good Man | last post by:
Hi I'm building a 'job posting' site of sorts. When a job is available in a particular state, I want the system to send an email to everyone who is 'watching' that state. I know how to do...
1
by: Stevio | last post by:
I have a guy asking me about the speed of downloads from his web site. I use ASP code to send the download to the user, and the code I use is basically like this: FileName =...
4
by: David | last post by:
I'm wondering if python is capable of fairly precise timing and also sending data out the parallel port. For example ; making a 7.5 KHz square wave come out of one of the data pins on the...
4
by: yaron | last post by:
Hi, I have a problem when sending data over TCP socket from c# client to java server. the connection established ok, but i can't send data from c# client to java server. it's work ok with...
0
by: Stewart | last post by:
Hi, I have a program which needs to send individual (customized) emails to a few thousand recipients. Using the standard approach SmtpMail/MailMessage method and Win 2000 server (SMTP service...
7
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server...
7
by: John Bailo | last post by:
I wrote a c# web service that sends an XmlDocument as a return type. When I run it on a w2k iis machine, it takes 35s to 45s to send the data to a client (I wrote a smart client c# app to consume...
4
by: Roger Withnell | last post by:
I'm sending Russian text in an email generated from the website which displays in the email as ?????????? The website is set to codepage 65001 and the charset to utf-8. Please advise. ...
4
by: David Hirschfield | last post by:
I have a pair of programs which trade python data back and forth by pickling up lists of objects on one side (using pickle.HIGHEST_PROTOCOL), and sending that data over a TCP socket connection to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.