3 ms·
GC shifts human work from development time to deployment / ops time. So the question is whether one-off developer time is cheaper than SRE time for the useful
by hedora 5y ago
GC shifts human work from development time to deployment / ops time.
So the question is whether one-off developer time is cheaper than SRE time for the useful lifetime of the service.
However, it gets worse for GC: depending on the application, developing for a GC can be much more difficult / expensive than manual memory management (or reference counting). The canonical examples are low latency (with SLAs on the order of a disk or network I/O, so 10-100 microseconds) and applications that need to use bounded memory.
On top of that, there are confounding factors that hurt the case for GC. I don't know of an imperarive GCed language with a reasonably expressive type system (all the JVM languages I know of use type erasure).
For experienced developers, rich type systems with actual runtime guarantees are a huge productivity boost.
- titzer 5y agoC#? F#? Go (now with generics)? Virgil...
- gwbas1c 5y ago> The canonical examples are low latency (with SLAs on the order of a disk or network I/O, so 10-100 microseconds) and applications that need to use bounded memory. Well, in those cases extra developer time is cheaper than a more powerful computer! Will you get ROI building a stereotypical web application with manual memory management? Doubtful. Edit: > GC shifts human work from development time to deployment / ops time. I've never had to tune a garbage collector in deployment. I've heard of other people having to do it; but I've never heard of anyone saying, "yes, I'm so happy I built my website with C++."
- Sindisil 5y agoAll the world is not a web application.
- Spivak 5y agoTrue but it’s not really about web and more about “problem domains where GC pauses are significant, matter, and you can’t throw more compute and memory at the problem” which is not nothing but on the dart board of all SWE jobs good money is on hitting one where it isn’t even if you’re aiming for one.
- gwbas1c 5y agoHowever, web development is by far the most common domain that people develop for; and most web sites do not run at the scale where they would benefit from the kind of performance tuning that involves manual memory management. (Good luck calling malloc from Javascript, or debugging use-after-free issues when you're iterating quickly.)
- kqr 5y ago> I don't know of an imperarive GCed language with a reasonably expressive type system Haskell with all code in the IO monad?
- im3w1l 5y agoNow I'm mildly curious how viable this would be.
- kqr 5y agoExtremely, if my last experience trying it (back in 2016 or so) counts. Like all good jokes, "Haskell is the world's best imperative language" contains a kernel of truth. The standard library contains rather interesting control structures that can exist only because IO actions are lazily evaluated values -- but you can also choose to ignore those for a more Java-like experience.
- spullara 5y agoYou don't consider Scala to have a reasonably expressive type system?
- LAC-Tech 5y agoI don't know of an imperarive GCed language with a reasonably expressive type system Well, we have no idea what you consider to be imperative and what you consider a reasonably expressive type system to be.
- native_samples 5y agoGC shifts human work from development time to deployment / ops time. Not unless you're load testing in production. Source: have been both a developer and an SRE in the past (an actual SRE, at Google, running services that used both manual memory management and GC). Now, often people do in fact load test in production but this isn't some intrinsic property of GC. Also as an ops guy at Google I had to track down a number of memory management errors/segfaults that only occurred in prod, which wouldn't have occurred in a GCd language. Often double-frees or use-after-frees that only occurred after very specific combinations of RPC responses or timeouts that corrupted the state machine trying to handle them. Not much fun. Also, you should be aware that "SRE" as a job role is deeply weird and most companies don't do what Google and fast-follower firms do. In most companies, ops people are cheaper than developers. Google was historically pretty unusual in demanding ops people who also happened to have histories hacking UNIX kernels but that was: a. Not consistent, even in the early days most SRE people had sysadmin backgrounds. b. To some extent because you would sometimes have to do things like ... debug segfaults in production. Frankly they struggled to keep devs in SRE. They were only able to do it for a long time because they were making job offers to SWEs conditional on them working in SRE for a few years. Don't want to do ops work? Tough, you don't get to work at Google at all then. The desirability factor of working at Google was higher than the dislike of doing ops, so, people would accept this offer (that's how I ended up there). But obviously this is only a viable strategy in rare cases. Most companies can't do that. Final point - your ideas about JVM GC are quite out of date. Modern JVMs are much better at auto-tuning. You can still squeeze extra performance out by tweaking obscure knobs and you should definitely tweak the one master knob that tells it whether your job is latency or throughput sensitive (i.e. batch or interactive). But that takes a few seconds and then you're done. I don't know of an imperarive GCed language with a reasonably expressive type system (all the JVM languages I know of use type erasure). Type erasure and GC are orthogonal. C# has GC without type erasure.