3 ms·
> How do people reason about performance in GC'd languages? I think there's a misconception about the fact that languages that have GC are slower than the ones
by ExoticPearTree 3y ago
> How do people reason about performance in GC'd languages?
I think there's a misconception about the fact that languages that have GC are slower than the ones that don't. It is universally true that you can write garbage code in any language, being either Java/C# or C/Rust.
Java a while back had the problem that when GC would run, the application would freeze for a bit due to how the GC worked. But, on the other hand, at least for Java, once everything was loaded, it would consume pretty much the same resources for 100 requests or 10000 requests because the language itself was very good at concurrency. On the other hand, C++ with boost would have it's own particular issues with concurrency and after a certain number of concurrent threads it would severely impact performance.
Those intrinsics are for people that know what they are doing, they know the architecture the code is going to run on and why using those is better than leaving to the compiler to optimize the resulting byte-code.
- kaba0 3y agoI see what you say, but have to nitpick this: “Java a while back had the problem that when GC would run, the application would freeze for a bit due to how the GC worked” — Java has pretty much always had the very best garbage collector available, though it was historically mostly interested in throughput-oriented workloads (due to its wide-spread usage in server software). Other platforms may not have had it as noticeable, but they just probably traded off throughput for better latency (e.g. Go still does it, by blocking threads that would allocate when it can’t “make sure” it will be able to keep up).