I'm planning a project that requires fast (as quick as possible) TCP server access. I've been testing out Java with Netty an开发者_如何学Cd C++ with BOOST. The project requires multithreading (if that affects any suggestions).
In my tests (not thorough, but enough to provide an insight) it would appear as though Java servers aren't anywhere near as quick to respond as those written in C or C++. Is this true or is my implementation/setup most likely wrong?
I've also got some experience in Objective C and if it were plausible, and the resulting application was fast enough, writing a server in Objective C would be great as it's the language I've got most experience with.
I know that someone will most likely respond saying that C is probably the best option for speed, but is there any significant overhead using an OOP language for networking? It seems as though the network speed would be the main bottleneck.
Thanks to anyone who is willing to impart some advice to an intrigued programmer :)
The first important thing for you is to focus on how you design your server. Saying that it will be multithreaded
doesn't tell us anything. Keep in mind that multithreading
is far from being the panacea, in particular situations multithreading can be even harmful.
After that you have a clear understanding of how your server should work - see what languages (or even frameworks) are there that allow you to implement what you want with reasonable efficiency/complexity ratio.
Most people would indeed tell you that C++ (or C) is the language of choice for your task as there are no limitations and you have direct access to all the functionality OS gives you, but still - there are plenty of other mature languages/frameworks and picking the right tool depends on details of what exactly you want to do
精彩评论