by pron · 13y ago · 0 comments
Go vs Scala: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
It will be interesting to re-visit this when Go 1.1 is out as well. Go being even younger than Scala has a lot of low hanging optimization fruit. :)
P.S. If Go didn't exist I would still be using Java/C#/C/C++ for everything. (I still use Haskell/Prolog where needed)
There is no such thing on that page. You see 30x times win for go only where program uses very small amount of memory. When memory consumption is big(regex-dna and binary trees), memory footprint is very similar for both scala and go(+-10%).
k-nucleotide 260,908KB vs Java program 167,924KB
regex-dna 679,836KB vs Java program 621,712KB
binary-trees 565,076KB vs Java program 528,364KB
and not much difference for this
reverse-complement 249,304KB vs Java program 298,904KB
http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
For tiny tiny programs that only allocate a few KB, the default JVM allocation swamps what the programs use -- that changes when programs need to allocate memory.
And no, don't bother mentioning nailgun or the like. Those cures are worse than the illness.
The benchmarks game measurements posted by voidlogic include JVM startup time and yet many of the Scala programs are faster than the corresponding Go programs, when the programs run for seconds.
So a Go n-body program can be faster than a Scala n-body program at 0.33secs over a small workload, but then over a larger workload take 32.1secs compared to 23.5secs for the Scala program.
http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...
http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
And mine do not. Furthermore, when you program is but one of many steps in a pipeline, but is not the bottleneck, startup time can have a very noticeable effect.
I've heard a million reasons why JVM startup times do not matter. You are telling me nothing new.
But for being so simple Go gives you a lot of tools as well: http://golang.org/pkg/runtime/pprof/ http://golang.org/pkg/net/http/pprof/ http://blog.golang.org/2011/06/profiling-go-programs.html Go also has gdb support I used from my IDE (http://golang.org/doc/gdb)