Yet, everyday, I have to field questions about why our low-level, network-facing system code is not written in C... old prejudices die hard.
Yet, everyday, I have to field questions about why our low-level, network-facing system code is not written in C... old prejudices die hard.
Really I think these days, in fact since the Morris Worm, people should be asking the opposite question: why is network-facing code written in C given that almost any error can lead to an exploitable security compromise?
I do not buy the performance argument at all any more. So few systems are really performance-constrained by network processing (usually it's the network itself or the disk), you have to write horizontally scalable code anyway if you want to make use of multiple cores, so almost all cases where it's a bottleneck are more cheaply dealt with by scaling rather than tinkering with the software.
There are people doing HFT in Java. The managed languages are quite capable of great performance with a little effort and imagination.
I'm asking because my own gut estimate of the cost of automatic memory management is significantly higher.
The cost of array bound checks is generally negligible with a modern compiler/CPU and the speed/safety tradeoff is not even worth haggling over for any code that's exposed to the internet.
In my experience of managed software 99.9% of performance problems are due to stupids and 0.1% are due to marshalling and GC costs. An average unmanaged developer seems to assume the opposite.
I mean, my experience is pretty much the same as yours, to the point where if someone blames the language for poor performance I'm immediately skeptical of the claim. But other cases do exist, is especially for problems that are CPU intensive.
It's a very legitimate question to ask how it was measured.
Obviously they're happy with their performance and we can't comment on that, but the other claims regarding speed vs. C were more general.
It's like saying that a reinforced door with a lock is more expensive and heavy than a regular cardboard-and-planks one, and is slower to open. It is! But is has other advantages, not attainable otherwise.
It's not correct to say that they use additional resources to provide memory safety or security.
Python for instance uses additional resources because it simply doesn't have a performant implementation and Java uses additional memory to gain execution speed.
Swift and Rust are memory safe, but don't need a GC, so those memory safety advantages are in fact attainable otherwise.
> I'm asking because my own gut estimate of the cost of automatic memory management is significantly higher.
Is reasonable and not dripping with bias? My gut estimate says it doesn't matter in many cases. So where does that leave us?
Based on submission history, I'd guess Haskell.
The typical factor mentioned in the Haskell world is 1/2 the performance of C.