Jump to content
  • Advertisement
Sign in to follow this  
NihilisticMystick

SDLnet vs. plain ole winsock

This topic is 4830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently working on something thats going to require a large amount of data throughput, however I prefer portability if possible. Thus I was curious as to whether or not there were any performance issues with using SDLnet over winsock. As in, if I use SDLnet will it run substantially slower in situations where a huge amount of data is going in and out. Thanks for any answer.

Share this post


Link to post
Share on other sites
Advertisement
What level of data throughput are you talking about?

Assuming that you can saturate a gigabit ethernet cable, that's about 120 megabytes of data per second. (Regular PCI, at 133 MB/s peak, actually has a hard time pushing this!)

A modern Pentium or Athlon with dual-channel memory can shuffle about 5 gigabytes of data in and out of main memory each second -- that is, you can copy data ten times before it's sent/received, and still have headroom to spare.

So, no, I don't think the API you choose will matter. The protocol (and implementation of it!) you choose will likely matter a lot more. For example, if you choose TCP, the NetBSD, Linux, or Windows Server 2003 might give you different performance for the same code.

Share this post


Link to post
Share on other sites
Quote:
Original post by Megahertz
I've been working on pushing gigabit ethernet and have come up pretty short. I've only been able to push it to 12.5MBps or so.

There's a thread located at the url below about it if you care to read. Might be helpful to the OP.

http://www.vanguardsoh.com/forums/showthread.php?threadid=19892

-=[ Megahertz ]=-


You might also try an Intel CSA Gigabit LAN motherboard (not using the PCI bus for GB LAN).

Also perhaps try testing with TCP and Jumbo Frames enabled. See http://www-iepm.slac.stanford.edu/monitoring/bulk/fast/ (~900Mbit/sec for some of the tests). A custom UDP protocol should be able to match this performance (provided TCP-like bandwidth adaption is used, else net throughput will be low due to packetloss).

Share this post


Link to post
Share on other sites
i think you guys are going a little off topic?

i did try SDLnet but on my windowsxp box i didnt work at all. but thats just me.

atm i just allways use winsock.

Share this post


Link to post
Share on other sites
Quote:
i think you guys are going a little off topic?


Perhaps my comment was obtuse. Here's what I was trying to say:

Compared to the limitation that your networking hardware constitute, the performance limitations of a wrapper like SDL compared to raw WinSock are likely to not matter (unless the wrapper is really, really bad).

Share this post


Link to post
Share on other sites
Quote:
Original post by ErUs
atm i just allways use winsock.


If you use Winsock/sockets directly, you'll be able to make performance improvements relatively easily as it is your own code. In some cases you'll need to use OS-specific calls to get maximum performance (such as using TCP Jumbo Frames* and/or other custom high(er) performance methods). Fortunately, most of the socket API is portable, and high-performance OS specializations can be abstracted/wrapped in your own network API (the highest performance Winsock calls (such as using OIO/IOCP, Winsock Direct) will require more work)). Thus, if you need maximum performance, you'll need to use the OS-specific performance optimizations (unless the custom socket library already implements such specializations).


*Jumbo Frame support appears to be enabled through OS/driver settings as opposed to runtime-configurable.

[Edited by - John Schultz on August 25, 2005 12:56:38 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!