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.
Related
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.
How much of a performance penalty are you paying when going to .Net from a vanilla c++ unmanaged environment. I have heard that the difference is smaller now than what it used to be?
I am referring to a PC environment and not embedded systems
The short answer, it depends on what you are doing. There are several places to read about this.
C++ performance vs. Java/C#
Head-to-head benchmark: C++ vs .NET
C# versus C++ versus Java performance comparison
It's absolutely depends on your project.
But remember itat .Net is not designed for high performance computing, but for high productivity.
So, in cases on stressing performance it will almost always loose in front of c, c++ or say python. But if you measure time you need deliver a simple windows based application, full of modern features,, the story almost always will be inverse.
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.
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).
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've been learning programming for some months now, mainly with java and C#. They seem so similar from my limited knowledge, so I'm trying to grasp an understanding of the practical differences. Could seasoned programmers please enlighten me as to which programming language is more suited for which kinds of jobs?
In what situation would you say "To create this kind of software, java is more suitable than C#" or "To create this kind of sofware, C# is more suitable than java"?
Java was originally designed to be the portable solution. If you need something to run on multiple operating systems you would probably want to go with Java.
From my experience in the financial world, the trend I see most commonly is Java being used on the backend (typically Linux servers) and C# (WPF) being used on the front end. I think this trend is here to stay until either Mono becomes widely accepted or Microsoft figures out a way to make their Server OS's free :)
I'm not saying Java is more suited for back end than C# (although I do think WPF has the edge over anything Java has for front end development) all I'm saying is that this is a very common trend in many financial/trading systems.
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.
This is a trend I've noticed. There is a very large adoption of ruby from the java community. Is it that c# is such an awesome language + having good tools over java that most c# developers aren't as keen to switching to ruby permanently as java developers are?
What are your opinions?
C# is a modern, and quite powerful language, sporting:
Lambdas (closures)
Continuations (yield)
Value types
Properties
Type inference
Pass-by-reference
...just to name a few.
These features make a transition from C# to Ruby far less attractive than a transition from Java to Ruby.
Because .NET is part of a coherent environment which includes developer tools, database links, orm management GUI front ends, net front ends etc. etc.
Java is a language! There are losts of piecemeal bits and pieces which do all of the above, but, the quality varies considerably. From something like Apache POI which is a better interface to MS Office documents than MS provides to the abysmal J2EE stack which half does in a very complicated way what .NET does in a simple and elegant way.
Whereas for Enterprise level, millions of transactions, bullet proof, fast never lose your data all the extra work putting together J2EE, JDBC, Spring, Hibernate etc.etc. etc. is actually worth it, for a quick simple Web to Database app its just too painful, hence the attraction to ROR.
On the other hand while .NET can scale up to the big stuff (not as well as J2EE! ) it is still reasonably straightforward to do a small application.
I see two reasons:
It seems to me that the biggest benefits of switching to Ruby for a Java developer are closures and dynamic type inference. Both of these can be found in C#.
.NET benefits from a rather tight integration with the Windows platform - (COM interop, WPF, easy installation), making it more difficult to switch from .NET to something else.