News for hackers. Stuff that matters.
Re:Introduction to Go 1.1 by melling on Tuesday March 26, 2013 @10:14AM (#5443389)
Even though they are somewhat contrived benchmarks, I still like to refer to the "Language Shootout" to get some idea of the quality of code that the Go compiler is producing. I would expect the numbers should be better than Scala, for example.

http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?t...

Re:Introduction to Go 1.1 by gillianseed on Tuesday March 26, 2013 @12:06PM (#5444188)
Yes I too find the Language Shootout a very interesting benchmark (while knowing full and well it's shortcomings) and it shows (imo) that Go has alot of work to do in the optimization department, something one can confirm by compiling cpu intensive go code using gccgo which will often yield great performance improvements.

Not surprising though, as GCC's optimization backend is very strong and has been developed for a long time, meanwhile Go's compiler toolchain is very young.

As for Scala vs Go, Scala compiles into Java bytecode and then makes use of Java's excellent and very mature JIT compiler so I'm not surprised Go loses out to it for the same reasons mentioned above.

Also note that the Go version used on the 'Language Shootout' is the 1.03 version, not the upcoming 1.1 version, it will be interesting to see what improvements in performance have been made.

AFAIK the 32-bit version of Go (which is what you compared with in your link) has not been given as much love in the optimization department as the 64-bit version, which I guess would do slightly better atleast.

Re:Introduction to Go 1.1 by onan_barbarian on Tuesday March 26, 2013 @08:16PM (#5446929)
Go's compiler toolchain is not "very young". Go's compiler toolchain is derived from the Plan 9 C compiler and is a decade older than modern gcc (4.x), which has substantially rewritten its optimization framework relatively recently with "GENERIC" and "GIMPLE". There are no equivalent changes in the go backend.

The reason the code quality (in optimization terms) of Go's compiler isn't that great is that the Plan 9 C compiler was always designed for fast compiles. This is a matter of design.

Re:Introduction to Go 1.1 by Scaevolus on Wednesday March 27, 2013 @02:51AM (#5448185)
The Go compiler converts its AST to assembly directly. There's a peephole optimizer and certain AST patterns are specially handled, but overall the compiler is extremely simple.

By comparison, LLVM/GCC passes code through multiple internal representations and performs many complex optimizations on them before emitting assembly.

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:16PM (#5444266)
>>while knowing full and well it's shortcomings<<

Without knowing it's name :-)

Re:Introduction to Go 1.1 by gillianseed on Tuesday March 26, 2013 @12:30PM (#5444374)
heh, well it was called the 'computer language shootout' back in the day and that's the name that has stuck with me.
Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:36PM (#5444412)
Back in the day, that old project wasn't on quad-core and wasn't on Ubuntu -- and we should wonder whether your understanding of what's shown is also 6 years out-of-date ;-)
Re:Introduction to Go 1.1 by mturmon on Tuesday March 26, 2013 @01:42PM (#5444866)
@igouy: you have now made three comments without any substance, but which question the expertise of the original commenter on the basis of a small issue of nomenclature.

If you have something specific to say, say it.

Re:Introduction to Go 1.1 by gillianseed on Tuesday March 26, 2013 @01:16PM (#5444686)
even if I google 'language shootout' the top link is the (now) correct 'Computer Language Benchmarks Game' and what is shown there is not 6 years old.

Is there a point to you continuing to spin on this???

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @01:22PM (#5444733)
Given that the banner shown on every web-page changed, do you think there might be other changes which you haven't noticed?
Re:Introduction to Go 1.1 by gillianseed on Tuesday March 26, 2013 @02:03PM (#5445001)
Like what? I come there for the benchmark results and for looking at the source code versions presented for the languages I'm interested in. The banner is of very little concern to me, which is why it hadn't registered with me.
Re:Introduction to Go 1.1 by im_dario on Tuesday March 26, 2013 @11:49AM (#5444077)
Just a note: Language Shootout is still Go 1.0.3. We are going to wait to see the new benchmarks.
Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:15PM (#5444259)
Go 1.0.3 is the latest release.
Re:Introduction to Go 1.1 by voidlogic on Tuesday March 26, 2013 @12:53PM (#5444519)
True, but it is worth pointing out because this discussion is about 1.1 and people might not realize those are 1.0.3 benchmarks.
Re:Introduction to Go 1.1 by voidlogic on Tuesday March 26, 2013 @01:08PM (#5444637)
"I would expect the numbers should be better than Scala, for example"

Maybe once 1.1 is out and the language game switches to it, that will be the case (the benchmark is using the current stable release of Go 1.0.3).

Also, I assume you are talking about execution time, Go destroys Scala in your linked comparison in terms of memory usage.

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @01:28PM (#5444777)
Please don't generalize from the memory use of those programs

http://programmers.stackexchange.com/a/189552

Re:Introduction to Go 1.1 by voidlogic on Tuesday March 26, 2013 @01:43PM (#5444874)
Interesting. It is pretty amazing and unfortunate after all these years (18?) Sun/Oracle hasn't made the default JVM memory allocation more adaptive/intelligent. Could the JVM -Xms option be used to try to mitigate this defect?

One note, Scala uses more memory than Java does, so it appears not all of this usage can be blamed on the JVM itself: http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?t...

Re:Introduction to Go 1.1 by igouy on Wednesday March 27, 2013 @01:30PM (#5450760)
Perhaps it is intelligent for the kind-of applications the JVM is designed for (rather than for tiny tiny toy programs).
Re:Introduction to Go 1.1 by voidlogic on Thursday March 28, 2013 @12:34PM (#5455853)
There are lots of useful commandline tools written in Java that would no doubt benefit. P.S. I did not downvote.
Re:Introduction to Go 1.1 by igouy on Thursday March 28, 2013 @02:11PM (#5456579)
That may be -- but are commandline tools the kind-of applications the JVM is designed for?
Re:Introduction to Go 1.1 by igouy on Thursday March 28, 2013 @12:29PM (#5455821)
Why the downvote?

Do you really think the JVM memory-use should be optimised for 100 line toy programs?

Re:Introduction to Go 1.1 by trailfox on Tuesday March 26, 2013 @01:02PM (#5444596)
> I would expect the numbers should be better than Scala

Why would you expect that? The JVM has years worth of advanced optimizations.

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:18PM (#5444274)
Where should we look for the "Language Shootout"?

The link you provided doesn't point to anything called that.

Re:Introduction to Go 1.1 by melling on Tuesday March 26, 2013 @12:22PM (#5444307)
Google it and see what you get. I typed "language shootout debian" to find the result. I guess Google still remembers its old name.
Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @12:32PM (#5444384)
You are nearly 6 years out-of-date. (Google "Sun Java" and see what you get, really.)
Re:Introduction to Go 1.1 by melling on Tuesday March 26, 2013 @01:04PM (#5444608)
Sun was purchased by Oracle for $8 billion dollars. It was big news. The Language Shootout changing its name didn't register. It's simply not that important. I understand now that the name has been change, but in a year when I feel like Google'ing it again, I can promise how I'm going to search for it, or refer to it.

On another note, your threads about the name change are adding little value to the conversation. Perhaps the time could be better spent? You are sort of wasting people's time. Next time, maybe simply say that the "Language Shootout" has been changed to the "Benchmark Game?"

Re:Introduction to Go 1.1 by igouy on Tuesday March 26, 2013 @01:16PM (#5444687)
>> It's simply not that important.<<

It's important as an indicator of how much or how little you noticed when you looked at those web pages.

Re:Introduction to Go 1.1 by eridius on Tuesday March 26, 2013 @05:30PM (#5446192)
I think the name is the least important thing on the page. Why are you so fixated on it?
Re:Introduction to Go 1.1 by igouy on Wednesday March 27, 2013 @01:47PM (#5450890)
It's a simple glaring example of not seeing what actually is shown on the web pages.

The other ways people don't see what actually is shown are more difficult -- taking memory use and code size measurements out-of-context.