Socket Recommendations [closed] - c#

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm doing a little research in developing a simple socket server that will run as a windows service. I'm going to write this in C#, but I've been made aware that .Net sockets are slllooooowwwww. For the initial roll out using the .Net Networking classes will be fine, but I'm wondering if anyone has experience with a high performance (and hopefully free) socket library. I'm thinking probably something written in c++ that I can use as a com object in .net.
I've used indy sockets before, but it doesn't look like there is any active development going on with the project anymore. I've done some googling and I've found a few libraries, but I was hoping to get feedback from someone who has actually used a socket library with good success.
Any help appreciated. Thanks.

I would revisit your initial assumption - I don't believe it's accurate.
In my experience, the overhead of using .NET's framework socket libraries is not high - they perform quite well. The main cause of very slow socket code, that I've seen, is when people try to port non-C# code into C# directly, in particular, trying to port synchronous C++ socket code. The sockets in .NET's BCL are all designed to be used asynchronously. If you try to force them into a synchronous model, you'll end up adding quite a bit of blocking, which definitely causes very slow code.
Try using the socket classes the way they were designed - I think you'll be very happy with the performance, as well as the usability.

Sounds like you are optimizing before you need to. I would go ahead and build it with .NET and see if you have a performance problem before you try to do something that would potentially be slower. COM has a lot of overhead.

Related

Consuming a SOAP Web Service with the lowest overhead [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm implementing a SOAP Webservice for sending thousands of emails and storing thousands of XML response records in a local database. (c#.net, visual studio 2012)
I would like to make my service consumer as fast and lightweight as possible.
I need to know some of the considerations. I always have a feeling that my code should run faster than it is.
E.g.
I've read that using datasets increase overhead. So should I use lists of objects instead?
Does using ORM introduce slowness into my code?
Is a console application faster than a winform? Because the user needs no GUI to deal with. There are simply some parameters sent to the app that invoke some methods.
What are the most efficient ways to deal with a SOAP Web Service?
Make it work, then worry about making it fast. If you try to guess where the bottle necks will be, you will probably guess wrong. The best way to optimize something is to measure real code before and after.
Datasets and ORM and win form apps, and console apps can all run plenty fast. Use the technologies that suit you, then tune the speed if you actually need it.
Finally if you do have a performance problem, changing your choice of algorithms to better suit your problem will likely yield much greater performance impact than changing any of the technologies you mentioned.
Considering my personal experience with soap, in this scenario I would say your main concern should be on how you retrieve this information from your database (procedures, views, triggers, indexes and etc).
The difference between console, winform and webapp isn't that relevant.
After the app is done you should make a huge stress test on it to be able to see where lies your performance problem, if it exists.

Compiling and Executing external code in C# [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am writing an application in C#, that will be Compiling and Executing external code written in either C, C++ or Java. In this regard, I have a few questions to ask and following is the research that I have done so far:
There will be a server that will host the application that will receive requests of code submitted by users. These requests will be sent on a particular socket.
There will be a receiver thread that would en queue all such requests into a queue.
There will be consumer thread that will dequeue from the queue and compile and execute the programs (submitted code). While compiling and executing, appropriate compilers and loaders will be used from the command line, which will be executed as processes from the C# App.
As of now, it can be assumed that security issues such as sandboxing, not making the server access public, etc have been / will be considered later. My primary focus is on this execution logic.
I have the following questions to ask:
Can there be a better way of doing this / Am I doing anything wrong?
Approach looks good on paper, but it mostly depends on the implementation.
As many as you want, up to the capabilities of the machine. OS will handle them.
It doesn't really matter as long as you make it airtight: malicious/malformed/plainly wrong code will be submitted: Java can't do that much damage, but C/C++ is kinda dangerous.

QuickFix C# or Python [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
We are about to implement a small automated securities trader. The trader will be build on top of the excellent quickfix FIX engine.
After due though, we narrowed our options down to implementing it in C# or in Python. Please specify the pros and cons of each language for this task, in term of:
Performance (The fact that Python uses a GIL troubles me in terms of thread concurrency)
Productivity
Scalability (We may need to scale this trader to a fully-sized platform)
EDIT
I've rephrased the question to make it less "C# vs. Python" (which I find irrelevant - both languages have their merits), but I'm simply trying to draw a comparison table before I make the decision.
I like both languages and a think both would be a good choice. The GIL might really be the most important difference. But I'm not sure if it's a problem in your case. The GIL only affects code running in pure Python. I assume that your tool depends more on I/O than on raw number crunching. If your I/O libraries handle the GIL correctly, they can execute concurrent code without problems. And even for number crunching you still have numpy.
My choice would depend on your existing knowledge. If you have experienced C# developers at hand I would go for C#. If you start absolutly from scratch and it's really 50:50, then I would go for Python. It's easier to learn, free and in many cases more productive.
And just to mention it: You might also have a look at IronPython. ;-)
For points "Performance" and "Scalability" I would suggest C# (although a large part of performance depends on your algorithms). Productivity is much of a subjective thing, but now C# has all cool features like lambda, anonymous method, classes etc which makes it much more productive.

Is there anything you can do in C++ that you cannot do in C#? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
I am trying to figure out if there is anything that you can do in c++ that you absolutely cannot do in c#?
I know that there are platforms that are targeted to native libraries, but I want to know if the lowest level c# can compare with the lowest level c++.
Device drivers. These applications operate in kernel mode, and .NET apps don't (they run in user mode). Even if you could, would you really want to? Probably not considering the overhead of the runtime and the relative difficulty of interfacing directly to hardware devices.
In software you can pretty much do anything given enough time and effort. It comes down to whether or not a certain task is practical rather than possible.
inline assembler
there are some very complex win32 signatures that cannot be used via p/invoke; the sspi security interfaces for example
Write Real Mode code. There is no CIL framework that runs in real mode, therefore C# cannot target it. C++ has been able to target real mode for decades now.
You can't use multiple inheritance in C# (Excluding interfaces).
In C++ you can overload more operators: http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B vs: http://msdn.microsoft.com/en-us/library/8edha89s%28v=VS.100%29.aspx
Well, C# handles all the memory management, so you're limited in terms of hands on memory management. This isn't really a bad thing though, as it takes a lot of work away from you as the coder. It becomes a bad thing if you're heavily concerned with performance (games and the likes).

Which language is most suitable for an efficient web-crawler? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
i need to write an web crawler and i need need which is best language for performance like memory and performance ..
Edit: Original title was "which language is optimized for speed and perfomance c++ or C#"
i need to write an web crawler
In that case, the internet traffic is probably your bottleneck, so the language does not matter at all.
I'd say that, if you know what you're doing, C++ is more likely to be efficient than C#.
On the flip side, C# is probably easier to work with and to optimize your app in.
So, since you have to ask, I recommend C# in your case. ;)
C++ virtually always offers the best performance of any language that supports modern programming techniques like generic programming and OOP. You pay a price for this though - it's substantially harder to use than C#.
Of course C++. You can manage every byte of memory there, while C# is Managed Code, where you tell the framework what you want to do and the framework does the things you usually do in C++. But if that's the main motive - don't stop at C++ and get right to machine code, Assembly.
A Google search would give you an instant answer - C++ is (generally) a better performing language.

Categories