4 ms·
How do you mesure performance against C ? Did you implement a rival unsafe C version to compete with, or is this just a guess ? If so, what makes you believe C
by rixed 9y ago
How do you mesure performance against C ? Did you implement a rival unsafe C version to compete with, or is this just a guess ? If so, what makes you believe C would only yield a 10% improvement?
I'm asking because my own gut estimate of the cost of automatic memory management is significantly higher.
- Quarrelsome 9y agoisn't this exactly the sort of line of questioning that the OP is complaining about? 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.
- blub 9y agoSome managed languages can have pretty good performance, but at significant memory usage cost. Performance is not a single dimension. 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.
- Quarrelsome 9y agoWhat part of: > 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?
- blub 9y agoI said it's a legitimate question to ask, not that their stated reason for asking is legitimate and I stand by what I said.
- nine_k 9y agoLook at the cost equation. Whatever additional resources they need to spend is a payment for improved safety / security. 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.
- blub 9y agoBy managed languages I understand memory managed, aka GC languages. 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.
- thehardsphere 9y agoThen you may not be working in the same problem domain as the person who asked the question. 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.
- rbehrends 9y ago10% is fairly typical overhead for mark-and-sweep GC for an imperative program. It requires artificially high allocations rates – that well-written imperative code shouldn't have – to go much higher than that. 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.
- barrkel 9y agoThe performance loss vs C is in that ballpark; arguably it's sometimes less, because of increased flexibility in refactoring. A bigger issue is memory overhead, that's often 100% larger, and it's harder to avoid. But memory is cheap.