Go perceived as slow in Stack Overflow

As part of my deep dive into Go I’ve also systematically gone through a lot of Stack Overflow questions with a Go tag. I’ve learned a lot, and also noticed quite a few outdated questions/answers. One question in particular was framing Go as way slower compared to Java.

I feel it would do Go justice to go and upvote some more recent benchmark results:

Hi Taavi,

I wouldn’t worry about that very much. It’s a very old post. I’ve been learning how Go is used in web development, and the consensus there is that Go is very fast because people are comparing it to Ruby, Python, and JavaScript/Node.js.

As for benchmarks, there is an old saying:

There are lies, damned lies, and benchmarks.

(A variant of a much older saying about statistics.)

It’s because benchmarks (like statistics) never tell the full story, and can easily be used to distort or spin the truth.

Here is a newer test. Go and Java seems to go head to head in runtime speed but java uses much more memory.

https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/go.html

2 Likes

@jayts. I appreciate your push towards not taking benchmarks as ground truth. I would add that just as the saying about statistics doesn’t mean statistics is useless, but that careless/manipulative usage of it can lead us away from the truth rather than towards it. So is with benchmarks. Beating the benchmark is not the goal. Improving the performance of something we are trying to measure with benchmarks is. In the current case with Go at Stack Overflow, the statement that Go is significantly slower than Java is not true (any more) according to the benchmarks, and there is no current reason to believe that the results are only a result of careless/manipulative benchmarking.

As Stack Overflow is highly influencial in the developer community, I felt it was unfair to leave that statement uncorrected with your help.

@johandalabacka - Thanks. I fixed a broken link in that Stack Overflow post to point to the link you provided.

2 Likes

Most of those benchmarks are measuring recursive functions. Go - unfortunately - doesn’t have Tail Call Optiomization and for that reason it is slow. You can check this article for explanation.

4 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.