Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / April 2006

Tip: Looking for answers? Try searching our database.

unmanaged WinSock V.S. System.Net.Sockets

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nadav - 30 Jun 2004 12:18 GMT
Hi,

I am about to write a performance critical application and I wonder what is the best way to implement it... Should I use the standart Win32 winsock DLL or should I rather use the new managed System.Net.Sockets library... from bench-marking tests I have done I have reached to the following conclusion:
Test description:
Bougth of the projects used a single IO Completion port for communication ( the managed proj used NetworkStream that use a common completion port internally ), bougth of the projects allocated the requiered memory apriory so the reception process will not require redundunt allocations.
the unmanaged C++ project resulted better performance, about 1.333 times of the managed project...
Taking those results in mind, I wonder...
1. Will microsoft keep supporting the 'old' winsock DLL ( which apparently give much better performance ) for porposes other then backword compatibility?
2. Does the .NET framework use the WinSock DLL or it rather communicate with the tcpip.sys driver directly through IOCTL calls?
3. What are the plans for Longhorn and for the next version of VS.NET? would the System.Net.Sockets library be optimized???

What should I choose to implement a performance critical application? unmanaged WinSock or System.Net.Sockets ?

Should I use Mixed mode C++? Would the wedby version of VS.NET have major changes for the Mixed mode C++?

Nadav
   http://www.ddevel.com
Steve McLellan - 30 Jun 2004 13:05 GMT
Bear in mind that code you write as unmanaged code may not necessarily be
the best implementation in managed code; it's possible you could squeeze
some performance out of the managed version by structuring things
differently. .NET makes development time MUCH shorter; unmanaged c++ is
quicker for processor intensive applications. But the limiting factor here
will be network bandwidth; unless you're doing tonnes of real-time
processing on the data you shouldn't see a big performance difference. You
usually only see a performance hit for really intensive computation (image
processing, for example).

Try posting the benchmark code you used; one of the gurus may be able to
give you some pointers.

Steve

> Hi,
>
> I am about to write a performance critical application and I wonder what is the best way to implement it... Should I use the standart Win32 winsock
DLL or should I rather use the new managed System.Net.Sockets library...
from bench-marking tests I have done I have reached to the following
conclusion:
> Test description:
> Bougth of the projects used a single IO Completion port for communication ( the managed proj used NetworkStream that use a common completion port
internally ), bougth of the projects allocated the requiered memory apriory
so the reception process will not require redundunt allocations.
> the unmanaged C++ project resulted better performance, about 1.333 times of the managed project...
> Taking those results in mind, I wonder...
> 1. Will microsoft keep supporting the 'old' winsock DLL ( which apparently give much better performance ) for porposes other then backword
compatibility?
> 2. Does the .NET framework use the WinSock DLL or it rather communicate with the tcpip.sys driver directly through IOCTL calls?
> 3. What are the plans for Longhorn and for the next version of VS.NET? would the System.Net.Sockets library be optimized???
[quoted text clipped - 5 lines]
> Nadav
>     http://www.ddevel.com
MikeFl - 17 Apr 2006 17:12 GMT
You are correct there is a performance difference between the two as yo
note.  We are looking at performance improvements to th
System.Net.Sockets class.  Feel free to email nclasks@microsoft.com t
request a feature or performance improvement to any of the classes i
the System.Net namespace.  

Btw, did you go with Winsock or System.Net for your project?  I'd lik
to hear why you chose one over the other.

The system.net team blog: [url]http://blogs.msdn.com/wndp[/url]

-Mike
[url]http://blogs.msdn.com/mflasko[/url



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.