5 ms·
We run high-load web services in something-other-than-c with managed memory and checked array access. It is native, 8/9 as fast as C, and it works. We will nev
by dsign 9y ago
We run high-load web services in something-other-than-c with managed memory and checked array access. It is native, 8/9 as fast as C, and it works. We will never have the budget to pay for the additional 1/9th that C would afford us, in terms of security concerns.
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.
- brainwipe 9y agoHave you ever been asked to switch down into Assembler mid-function in C to solve timing issues in the hardware? I have... but that was 20 years ago!
- Cthulhu_ 9y agoWhat counters do you offer though? Or maybe reverse the question - why do they think you should use C? That last 1/9th performance? I'm pretty sure that last factor also isn't due to the language and there's still room for performance improvements.
- code5fun 9y ago"something-other-than-c" Which letter?
- JustAMinute 9y agoIf you haven't written a version of it in C, how do you know it's 8/9 as fast. What are you basing that figure on.
- rixed 9y agoHow 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.
- weberc2 9y agoCan I ask what it is?
- s_kilk 9y agoMy money's on Go.
- rlonstein 9y ago> My money's on Go. Based on submission history, I'd guess Haskell.
- s_kilk 9y agoAh, now that’s intriguing! Thanks
- weberc2 9y agoSeems like it would be hard to get Haskell to run 8/9 as fast as C. Haskell is much harder to reason about performance than Go or C, and it's pretty easy to make a seemingly innocuous change that slows your program dramatically.
- tome 9y ago> Seems like it would be hard to get Haskell to run 8/9 as fast as C. The typical factor mentioned in the Haskell world is 1/2 the performance of C.
- pjc50 9y ago> why our low-level, network-facing system code is not written in C 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.
- elevensies 9y agoWatching Heartbleed and Cloudbleed happen really drove it home for me. Given that routine programming errors can cause private data to be transmitted unintentionally, I have to question the sanity of writing networking software handling private data in C.