Can some one explain the architecture of GO lang, Is it faster compared to Nodejs & if so what makes it faster and Go is developed using C/C++, So, does GO beats out in performance when compared to C/C++ and is the only difference between C/C++ & Go is all about more functions which makes developer easy to code using GO?
1 Answers
Note that Go 1.5 will feature its compiler, assembler, linker, and runtime written entirely in Go.
The goal is to have Go written entirely in Go and to rid the codebase of any C code. The only exception to the C code is for Cgo.
(See Go 1.5 Bootstrap plan)
The speed is more about about the native code generated, and the simplicity of the language (no genericity means less dynamic data to keep track of)
Go hasn't been always fast: "Why is go language so slow?".
It improves incrementally, notably on the garbage collection side, and stack management side.
Uvelichitel mentions below x64 Ubuntu : Intel® Q6600® one core -- Computer Language Benchmarks Game
As for "Golang Architecture", this doesn't really apply here (as detailed in this answer):
Go has no VM like the Java JVM. It compiles straight to metal like c/c++.
The Go 1.3 Linker overhaul mentions:
The current linker performs two separable tasks.
- First, it translates an input stream of pseudo-instructions into executable code and data blocks, along with a list of relocations.
- Second, it deletes dead code, merges what’s left into a single image, resolves relocations, and generates a few whole-program data structures such as the runtime symbol table.
-
have you seen any serious Go vs. V8/Node benchmarks? the "language shootout" project doesn't include JS for some reason. – Not_a_Golfer Feb 02 '15 at 08:44
-
@Not_a_Golfer No, I have not. I only know that performance is only one of the factors when switching to Go (as in http://thenewstack.io/from-node-js-to-go-why-one-startup-made-the-switch/) – VonC Feb 02 '15 at 08:50
-
AVonC, any idea on architecure for GO lang – user3753986 Feb 02 '15 at 09:11
-
@Not_a_Golfer Seems the "language shootout" project does include JavaScript V8. – Uvelichitel Feb 02 '15 at 10:05
-
oh, found it. I was looking under x64-quad core, and apparently, it doesn't have v8 benchmarks. http://benchmarksgame.alioth.debian.org/u64/compare.php?lang=v8&lang2=go – Not_a_Golfer Feb 02 '15 at 10:32
-
@Not_a_Golfer http://benchmarksgame.alioth.debian.org/u64/compare.php?lang=v8&lang2=go – Uvelichitel Feb 02 '15 at 11:26
-
From the bench marks I could see c++ is much faster than go, any reason we need to choose go lang over c++? I have seen the bench marks in the following link: http://benchmarksgame.alioth.debian.org/u64/compare.php?lang=gpp&lang2=go – user3753986 Feb 03 '15 at 03:17
-
@user3753986 fir the same reason Rob Pike invented Go after seing a C++ presentation about memory management: much simpler to maintain. After that, it is a question of use case: for concurrency, Go is much simpler to use. – VonC Feb 03 '15 at 06:18