Not convinced about that sentiment at all. Things are moving to the cloud where distributed systems, resiliency and scaling/load distribution are more important factors than outright execution speed. C/C++ remains popular because it is still the ultimate low-level systems language, and because of sheer vast quantities of legacy code.Actually the advantages of C and C++ are growing as more and more people are using more and more infrastructure.
To be clear, JIT does not imply GC too.The costs of a JIT compiled language become less and less appealing because the programs become more and more expensive to run, and then things like garbage collection can be very disruptive.
To be perfectly clear, JIT does not mean a program needs to be recompiled upon every execution. See Java's HotSpot JVM. See .NET's RyuJIT.
It sounds like the wrong language was chosen for this particular project. Is it a high frequency trading system? Not surprising that Java was inappropriate. Even still, LMAX managed to tame Java just fine. There is plenty of tricks to better control the GC. Having said that, Java's lack of value types support was always going to mean its more GC-heavy than say C# because everything is allocated on the heap. Only primitive types in Java can be passed around by value.A firend of mine is porting a large server infrastructure to C++ from java because despite spending significant money on trying to tame the garbage collection it just was getting to intrusive, C# was trialled and was deemed worse for some reason, so everything is getting ported to c++ so there can be better control of resources.
What version of C# and CLR were you using? Both MSCLR and Mono have made massive performance improvements in the last 3 or 4 releases.
With C++ you introduce a whole new set of problems, by the way. You do gain out-right control over performance. But writing performant code is still hard to do correctly, especially since C/C++ are highly imperative languages that encourage mutability by default.
Not true. See JVM HotSpot. .NET has NGen... and RyuJIT is coming.The compilation issue for server side systems is meaningless because you have the program compiled for the specific architecture. Why compile a program every time you want to use it, nothing has changed since the last time you ran it.
You also wrote later on that you "don't have control over your clients servers" therefore it appears you will needing to be compiling your C/C++ to the lowest common denominator of instruction set support. Otherwise you'll have customers complaining that your software doesn't work on the CPU of their server. Contradicting yourself.
There's plenty of scenarios where C#/Java/F# have the same percentage of legs on C++. It's swings and roundabouts. You can introduce mutability to gain back performance in lots of situations but it is only rarely actually required. It sounds like this particular server application has a rather large critical execution path that needs optimising. It sounds like there may be architectural problems with its design. But who knows from where I'm sitting.The architecture specific optimizations of JIT are typically way over stated. The last time I saw a comparisons (a few years ago no so things might have changed) there was typically only a few percent difference, while using c++ instead of C# or Java can easily get you a 500% speed up.
Ignoring HotSpot / NGen / RyuJIT... why is startup time an important metric on server software? Server software starts up and then just stays running. Within a short time all the critical execution path will have been JIT'd. Without rarely used code paths remaining unJIT'd.And JIT suffers form the fact that it has very limited time to compile.
See HotSpot and RyuJIT.Ideally you need need a combined system, precompiled but some form of online compilation that can make limited modifications.
Your conversation was about performance, now it's switched to importance. Nobody denies C/C++ are important languages. Whether they are appropriate for new server-side projects is an open question.The importance of c/C++ is supported by evidence with c and C++ continuing to remain steady with a significant market share, C still has the largest market share and c# only has 60% of the market share of C++.
If you are proposing the OP learn C/C++, fine. But he should be prepared that 99% of projects he'll be offered are legacy code that he'll merely be fixing bugs in or eeking out more performance. A minority of C/C++ developers will be offered greenfield projects but you'll need to be a good developer with years of experience to be offered such opportunities.Java continues to be strong and more or less equal to C, and that is largely bolstered by android. Objective-C before the Iphone release was more or less unheard of but now sit at 12% or so, over 3X more than C# for example. It would be nice to know how much of the Java coding is specifically for android and remove this to see both the desktop and server market share in isolation. I'm very confident if you looked at server and desktop markets then c++ would equal Java for market penetration.
Get out. Every single buffer overflow and null pointer reference in history just laughed you out with that sentiment.And lastly "you will find stability pretty much always trumps speed", yep, but c++ is more stable than many other languages.
C/C++ are not "stable" (odd term in this context, but I'll run with it for now) languages. They require an expert hand to keep things in check. One must practice extreme discipline to remain on the "rails" as it were. See lack of immutability and its form of type safety being of an extremely old generation.
Because writing servers in Python, along with any dynamically typed language, is a stupid thing to do. Not because C/C++ is a better alternative. A single bad keystroke on a C/C++ program and you'll be crashing hard too.I've had a python server crash months after release because of the lack of type safety.
You can take out GC locks to prevent a GC occurring at a critical time. There is also the Concurrent GC that Java and .NET both have, which further minimise the likelihood of even needing a GC lock.And anything that uses garbage collection is dubious to be called stable - you can't gurnatee when the GC kicks in and your server stutters.
But come on, how many server sides are doing time sensitive work like that? Must be 1%. And not likely to be easy projects for a new developer to be on. Those sort of projects are for veterans.
1.1 is ancient. Not much else to say on that.We also have a c# server that falls over regularly due to a stack corruption in the CLR caused by a different c# process (this is .NET1.1 but we have no control over clients servers).
Last edited: