9 ms·
How good is go compare to c/c++ ? ( in terms of speed especially ? ) Can we now say that Google Chrome can be written in Go and it will be faster and/or stabl
by iamgopal 15y ago
How good is go compare to c/c++ ? ( in terms of speed especially ? )
Can we now say that Google Chrome can be written in Go and it
will be faster and/or stable ? ( not saying it is not already. ).
Congrats to the team, just started using go yesterday and loving it.
- blinks 15y agoThe language is interesting, at the very least -- concurrency primitives are nice, and the interface-based type system works for most cases (generic containers notwithstanding). The major speed problem right now is GC, but that should be improving quickly.
- ConstantineXVI 15y agoChrome will still be (mostly) C++ for a while. Even if they rewrote V8 and the UI; WebKit is still C++ and I doubt Google plans on ditching it without a very good reason.
- rsc 15y agoIn my experience Go is probably 5-10x faster than C or C++. I estimate that programs that take me half an hour to write in Go would take me about 2½ hours in C and 5 hours in C++. (If you meant CPU speed, http://blog.golang.org/2011/06/profiling-go-programs.html http://blog.golang.org/2011/06/profiling-go-programs.html :-)
- chmike 15y agoThe day Androïd will be written in go, we will see a significant performance boost and battery lifetime extension. I don't program for Androïd just because I can't bare eclipse. An IDE as simple and efficient as QtCreator would generate a conversion tsunami.
- jemeshsu 15y agoThe day when Google supports Android native app development in Golang, will be the day when Golang goes mainstream. But I don't bet on this thing happening.
- ootachi 15y agoNonsense. You would hate Android written in Go, because of the GC pauses. Dalvik has a concurrent garbage collector; Go has a stop-the-world one.
- drivebyacct2 15y agoOnly because that's all that's been implemented. They're well aware of GC and compiler optimizations being a target for future versions of Go.
- deleted 15y ago[deleted]
- ootachi 15y agoChrome could not be written in Go, due to the stop-the-world GC. 200ms GC pauses are completely unacceptable for a web browser.
- canop_fr 15y agoI see a lot of very good reasons for Google not to lose time rewriting Chrome in Go, even without thinking about webkit, but do you have a reference to support this "200ms" assumption ? I never observed this in my programs (which doesn't have the kind of brutal allocations that a browser must have) so I'm curious.
- dsymonds 15y agoootachi does seem to like to pop into discussions about Go, throw around statements about Go's GC as if they were facts, despite never having used Go. A 200ms GC pause is entirely possible for a busy, unoptimised server. The question you should be asking, though, is whether it's a problem. And if (and only if) it's a problem, whether the programmer has tried to reduce allocations. The easiest way to reduce GC time is to produce less garbage.
- ootachi 15y agoNow you've moved the goal posts. You can write free lists manually in Java as well. Doing so is incredibly awkward in Java or Go, compared to C++ where placement new makes it fairly straightforward (and moreover, you can use reference counting without too much trouble either). You can also use a real-time GC for Java, and you don't have that option in Go. This is perhaps uncharitable, but you're basically saying "our GC is bad, but you can work around it so it's okay". Furthermore, you're implying that I'm saying something false ("as if they were facts"), but acknowledge that it is "possible". So I'm actually not seeing where I was wrong. And I have used Go. I didn't like it. I realize I'm in the minority, but there are valid reasons for disliking Go.
- dsymonds 15y ago
- deleted 15y ago[deleted]