On Sun, 2015-08-23 at 11:26 +0000, rsw0x via Digitalmars-d-learn wrote: > […] > > https://groups.google.com/forum/#!msg/golang > -dev/pIuOcqAlvKU/C0wooVzXLZwJ > 25-50% performance decrease across the board in 1.4 with the > addition of write barriers, to an already slow language.
Garbage collection is a hard problem for performance oriented code. I am sure someone will come up with a way of improving the Go one. "Across the board" though does worry me, my codes never get a sweep. D's garbage collector could also do with some work. > random benchmarks of Go performing 3x(+) slower than C/C++/D, > some of these predate Go 1.4. > https://github.com/kostya/benchmarks > https://benchmarksgame.alioth.debian.org/u64/benchmark.php?test=all&l > ang=go&lang2=gcc&data=u64 > https://togototo.wordpress.com/2013/07/23/benchmarking-level > -generation-go-rust-haskell-and-d/ (gcc-go performed the _worst_) > https://togototo.wordpress.com/2013/08/23/benchmarks-round-two > -parallel-go-rust-d-scala-and-nimrod/ (and again) > https://github.com/logicchains/LPATHBench/blob/master/writeup.md > (once again, Go is nowhere near C/C++/D/Rust. Where is it? > Hanging out with C#/Mono.) Thanks for those pointers, I shall have a look at them. Sadly though not for a couple of weeks due to various commitments. > Go is slow. These aren't cherrypicked, just random samples from a > quick Googling. But why use absolutes. Go may be slow for you in your context, but that doesn't mean the observation applies everywhere (note the interesting turn of phrase). For my (admittedly small) codes that do not cause a garbage collect and are basically just a loop, I find things are fine. So for a π approximation sequential code using 64-bit: C, gcc -O3: 8.847241 C++, gcc -O3: 8.916043 Fortran, gfortran -O3: 8.893000 D, ldc -O -release: 8.722329 D, dmd -O -release: 8.787744 Rust, cargo --release: 8.715818 Go, gccgo: 8.823525 Go, 6g: 8.824643 Go is definitely not slow there then. Thus Go is not slow. > Where is Go performing "C-level speeds" at? D claims this, and D > shows it does. Go falls into the "fast enough" category, because > it is _not_ a general purpose programming language. So unless > multiple randomly sampled benchmarks are all wrong, I'm going to > stick with 'Go is slow.' You are mixing too many factors here. "General purpose" has nothing to do with performance, it is to do with can the language describe most if not all forms of computation. Go is a general purpose programming language just like C, C++, D, Rust, Haskell, OCaml. If for you Go is not performant enough, that is fine. But for many people in various contexts, Go is more the comparable with other languages. This is not just "Go is fast enough", but "Go is as fast as any other option". -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part