10 ms·
> is not as advanced as Java's or Go's. golang's GC isn't advanced either.
by apta 7y ago
> is not as advanced as Java's or Go's.
golang's GC isn't advanced either.
- Thaxll 7y agoI'm not sure what qualified for an advanced GC but Go is the leading GC with Java and C# so ... https://blog.golang.org/ismmkeynote https://blog.golang.org/ismmkeynote
- The_rationalist 7y agoI don't know if it's a consequence of their GC, but go is significantly slower than Java or C#.
- Thaxll 7y agoYou're mistaken, Go is on part with both languages, usually faster.
- dralley 7y agoMy understanding is that it has lower latency but also lower throughput. Although most of the benchmarks I've seen are at lease 2 years old. It would be nice to see some updated benchmarks that also compare against the Shenandoah and ZGC garbage collectors for the JVM.
- apta 7y agoJava is getting two new low latency collectors. golang is stuck with a GC that favors latency over throughput, making it not suited for high throughput processing.
- hu3 7y agoBy stuck you mean Go devs made the sensible decision to have only one, zero configuration, ultra low latency, Garbage Collector that suits Go's common use cases instead of trying to be jack of all trades having many GC's each with their pletora of knobs to adjust.
- apta 7y agoIt means that golang is relegated to simple server side tools, and not suited for a broader range of programs like the JVM is.
- hu3 7y agoYep. Go has a focus. That's how you get from zero to heavy usage in companies like Uber, Twitter, Cloudflare, BBC, Basecamp, Canonical etc... in less than a decade.
- apta 7y agoYou'd be surprised at the extent hype influences decision making when it comes to choosing which language to use (even in companies you mentioned), at a significant cost down the line. I'll just say I know people at one of the companies you mentioned, and the amount of friction and cost due to them using golang is quite remarkable.
- hu3 7y agoNo offense but I'd rather trust the engineers of all these companies combined over an anecdote on the internet. Not to mention technology change always generate friction. You just can't please everyone.
- pjmlp 7y agoThe same kind of companies that were all hyped up on Ruby on Rails, and then moved to Java when performance mattered. Hype driven development is a thing.
- apta 7y agoFor real world, non-trivial programs, golang lags behind Java/JVM.
- The_rationalist 7y agoWell, on the benchmarckgame (internet reference for microbenchmarks), you're mostly right, go is faster than Java but slower than c#. But real-world applications performance needs fine tuned libraries that scales and this is where Java destroy both go and c#.
- apta 7y agoTake the benchmarkgames site with a big grain of salt. They're running on an old processor, and that biases results a lot. For example, someone submitted a patch that significantly sped up a Java benchmark by using `Math.fma()`. However, because the processor the benchmarks site is running on is old and does not support the underlying instruction that `Math.fma()` uses, it ended up way slower. I ran several benchmarks locally on a CPU that's a few years old where the benchmarks site shows golang being faster than Java, without changing the code, and I got the opposite result (Java was faster). Especially the longer the program ran. For example, the site shows that golang is faster in the spectral norm benchmark. Running it locally with a larger input parameter: golang: time ./test 30000 1.274224153 18.81 real 70.19 user 0.38 sys Java: time java spectralnorm1 30000 1.274224153 16.18 real 105.95 user 0.45 sys Or with the nbody benchmark: golang: time ./nbody 60000000 -0.169075164 -0.169012474 6.09 real 6.04 user 0.02 sys Java: time java nbody 60000000 -0.169075164 -0.169012474 6.04 real 5.94 user 0.06 sys
- Thaxll 7y agoFastHTTP destroys Netty, isn't Netty a fined tuned library?
- e12e 7y agoI'm not sure - I don't use either go or Java much these days - but some cursory googling implies that light-4j/undertow core is to fasthttp as netty is to net/http? https://github.com/networknt/light-4j/ https://github.com/networknt/light-4j/
- 7y ago
- sorokod 7y agoThe page you link to does not compare Go's GC to Java's or C#'s
- littlestymaar 7y agoIf you are interested on that topic these two posts are a must read: - https://blog.plan99.net/modern-garbage-collection-911ef4f8bd8e https://blog.plan99.net/modern-garbage-collection-911ef4f8bd... - https://blog.plan99.net/modern-garbage-collection-part-2-1c88847abcfd https://blog.plan99.net/modern-garbage-collection-part-2-1c8... The main takeaway is that saying that Go is the leading GC is just a (somewhat dishonest) PR move, and Go's team made a pretty good GC given there project constraints, even of it is not at the state of the art at the moment.
- Thaxll 7y agoI never said that it was state of the art or "the" leading, my point is Go GC is currently a good all-arround GC, and I've read that article, I think the author is bias against Go and currently there is no article even proving that the 2 new Java GC are faster than the Go one. ( or even faster than G1 ) You know when you end your article with "Overall, it looks to me like the Java guys are winning the low latency game." when none of those GC are actually production ready ... Go GC low latency has been stable and used for some time now. Out of the box Go GC is very good and doesn't need all the memory or the tunning from G1. ( I spend years tunning GC for Java application it's a nightmare )
- geodel 7y agoThis is must read only for GC theory enthusiasts. Java GC is advanced and better performing but that is adjusted by Java program's heavy garbage generation. So overall gain by advanced GC is little if any in Java.
- tick_tock_tick 7y agoDepends what you mean by advanced. In many ways it's more closer to achieving it's stated goals then Java's.
- apta 7y agoJavas GCs already achieve their goals. The JVM has several GCs to select from based on the needs such as: high throughput, very large heap sizes (up to the TB range), and there are two in experimental phase for very low latencies (ZGC and Shenandoah).
- hu3 7y ago> Javas GCs already achieve their goals. So does Go. Otherwise it wouldn't be anywhere as popular specially with regards to server-side usage by giants of the industry.
- pjmlp 7y agoGoogle's stamp helps. Java GC don't need allocation tricks of several GBs, like Twich was forced to do.
- tick_tock_tick 7y agoTwitch did that since they preferred to use code over environment configuration. They could have achieved similar results using the GOGC environment variable but didn't want too; They even said so in there post.
- lightgreen 7y ago> very large heap sizes It is not heap size that matters, but how often old objects are mutated. Basically, if you have 1TB of immutable objects, you are lucky, but if you constantly modify all the heap, then you will have a lot of headache. GC authors continuously mislead on this issue for many years (they promised the same with multi gigabyte heaps but with G1 several years ago).