4 ms·
I don't know if it's a consequence of their GC, but go is significantly slower than Java or C#.
by The_rationalist 7y ago
I 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.
- hu3 7y ago
- aratakareigen 7y agoThis is not a sensible decision, it is an idealistic one, and Go will backtrack on it if it lives long enough. People have different use cases, and they will be more than willing to turn a few knobs if it saves them millions of dollars.
- 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