6 ms·
Things that make Go fast* *compared to non-native languages like Python and Java. Could people please stop calling their favourite language fast just because
by HeroesGrave 12y ago
Things that make Go fast*
*compared to non-native languages like Python and Java.
Could people please stop calling their favourite language fast just because it beats an interpreted/VM language.
- Dewie 12y agoIs Go even faster than Java at this point? Last I saw, it wasn't quite there. The only comparison with regards to Java was with the representation of integers, IIRC, which isn't really a native vs VM issue.
- NateDad 12y agoFor pure processing speed, Go is pretty comparable to Java for code that does not heavily rely on generics. http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=go&lang2=java&data=u64q#faster-programs-measurements http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t... What Dave's presentation mentions is the memory... note the huge difference in memory footprints of the programs. That's where java loses heavily, and that can affect speed as well, which was his point.
- ssmoot 12y ago> for code that does not heavily rely on generics Does adding Generics heavy code move the needle in Java's favor? As a Scala developer your comment just jumped out at me because even doing a lot of Akka this past week, there's hardly a line of code that doesn't instantiate or manipulate a Generic. Just curious. I'm sure Go will get faster. I'm sure it's better suited to certain problems (memory constrained especially).
- seanmcdirmid 12y agoNo. If you don't use generics in Java, you get the same memory footprint of not using generics (or since it doesn't have type parameters, using any) in Go. So the author is making an unfair apples-oranges comparison when the apples-apples comparison is quite obvious: one can write an int-list in Java just as easily as they can in Go. Frankly, this is just strong intellectual dishonesty.
- stcredzero 12y agoFrankly, this is just strong intellectual dishonesty. If you're going to harp on rigor, then you need to consider then eliminate the prospect of an honest mistake.
- seanmcdirmid 12y agoIntellectual dishonesty doesn't mean lying, it could just mean "honest mistakes" that fail to apply proper reasoning and comparisons.
- stcredzero 12y agoRight now, you seem to be making an "honest mistake" with my referents. You seem (atypically) weirdly consistent with such honest mistakes in these threads. What is the lie, exactly?
- pjmlp 12y agoNot only that. Usually these comparisons cleverly leave out AOT compilers for the said languages to make theirs look better. In Java's case there are quite a few JVMs, many of those with AOT compilation to choose from, even implemented in Java itself.
- marktangotango 12y agoFor Java can you name any AOT compilers besides Excelsior JET and GCJ?
- pjmlp 12y agoGCJ is dead. Yes, CodenameOne, JamaicaVM, Aonix Perc and J9 all support AOT compilation besides normal JIT. The Oracle Hotspot replacement project, Graal allows for AOT compilation via SubstrateVM. There there is RoboVM for targeting iOS applications, with WP support getting added now. Android is replacing Dalvik with ART, which does AOT compilation at installation time. Probably a few more that I am not aware.
- marktangotango 12y agoThanks for the info, interesting the first four you mention are commercial products. Two you may find interesting: avian vm, and xml vm at one point could translate jvm bytecode to c for compilation with gcc.
- 4ad 12y agoNo, compared to nothing. Go is fast (or at least that's what Go programmers feel when they are using it). If they want to know why, they can read this article. This article is not Go vs. Java vs. C++ advocacy, don't try to make it looks like it is. It makes no claim Go employs better optimization technology than C++.