4 ms·
>*The Go Language is faster than the Computer Language Benchmarks Game thinks That's what Go advocates always say, but, for a static language with tight memory
by batista 14y ago
>*The Go Language is faster than the Computer Language Benchmarks Game thinks
That's what Go advocates always say, but, for a static language with tight memory structures, it's not that fast at all.
Now, he does compile with gcc go, which is faster, but using the go tool I frequently find for lots of use cases it's about 50-100% faster than Python, or 2-5 times slower than Java.
Not every impressive -- it probably needs a better compiler with more optimizations and a better GC.
When you point that out the the golang mailing list, it's mostly met with la-la-hands-in-the-ears denial, and suggestions to rewrite your program in a smarter way and micro-optimize it. But I don't want to find the optimal algorithm for something -- I want to compare speed, and for that same-ish algorithms in same-ish languages are fine.
(Though, Russ Cox said the current HEAD has a lot of optimizations and is quite faster, so things might be improving there).
- ramchip 14y agoWhat do you mean by "100% faster"?
- batista 14y agoTakes half the time to do the same task, how about it?
- tptacek 14y agoNot meaning this snarkily, but: if you write a program in Java and it's 2x faster than a Go program written in the same style, why not just write in Java?
- batista 14y agoWell, and I mean this kinda snarkily, who said people don't? I, for one, found that for some kinds of work I do, Go doesn't give that much of a performance advantage, so I'm exploring other languages. That said, even if Java gives you 2x, that doesn't mean that you shouldn't complain about Go. E.g you might like Go's semantics and syntax, or it might have other benefits for you. That you like those things about Go, doesn't mean you don't get to say "shame about the performance".
- tptacek 14y agoI guess I'm just saying, Go's syntax and semantics aren't enough of a win for you to deal with the performance hit you take compared to Java. So use Java. It's not a moral issue.
- wonderzombie 14y agoIsn't this purely subjective, especially re: semantics? It's a lot harder to measure the value of simplicity, but I'd argue that it has implications for the lifetime of your program well beyond benchmarks. It seems shortsighted to trade-off on performance alone. Would Java have been so widely adopted in the first place had that been the prevailing attitude?
- batista 14y agoWell, I hoped to use Go to avoid both: a) writing in C for performance (and having to setup glib et al to make it comfortable) and: b) carrying the JVM with me to run something. (And, no, I won't consider AOT compilers for Java. I want to deal with reasonably mature and widespread technologies and tooling). So, there are my constraints. Given those, maybe C++ is the ticket. D is not mainstream enough, and Rust I've played with and I like very much but is still in flux.
- tptacek 14y agoI wrote three paragraphs of response here, as is my wont, and realized before hitting "reply" that that's the wrong tack. Let's be specific. What are you building or considering, where your current options are C and the JVM? How does Go fall down on that work load? I've got a fair bit of professional experience in both C (~10 years shipping code continuously in it) and Java, and I've spent the last couple weeks in Go --- not long enough to be a true believer, but enough to have some practical experience.