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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
chrisben said:
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.
 
chrisben said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top