4 ms·
For all the talk of the speed benefits of Go, and it being static et all, I don't see much improvement over, say, Python. A lot of the questions re speed bumps
by batista 15y ago
For all the talk of the speed benefits of Go, and it being static et all, I don't see much improvement over, say, Python.
A lot of the questions re speed bumps on the mailing list are answered with "those are microbenchmarks, what matters is real cases" and generally a "lalala hands in the ears approach", even when it's obvious that the problem is deeper than some microbenchmark only case.
Like this example:
https://groups.google.com/forum/?fromgroups#!topic/golang-nuts/HDz5KiG6oMY https://groups.google.com/forum/?fromgroups#!topic/golang-nu...
[Downvote? Something very controversial about hashmap O behavior?]
- jacquesm 15y agoYou could compare python with perl or php, you could compare Go with C, C++ or Java. But to compare Go to Python is a bit weird. Of course, you could do it, but why would you, almost every metric that you'd want to use would be off. You're comparing a compiled language with lightweight threads aimed at just-above-low-level programming backed by a single vendor with an interpreted language that is mostly geared towards single threads of execution with a very high level of expressiveness that is developed by a bunch of open source gurus under the supervision of a benevolent dictator.
- dripton 15y agoI think it's fine to compare Go and Python. They're both general-purpose programming languages. When choosing to write a new program, you can often pick either of them. I can imagine problems where either might be a reasonable choice. In fact, there are programs that I've written in both. (Granted, those were Project Euler exercises, not code that someone was paying me to write.) Don't get too caught up in the marketing.
- jacquesm 15y ago> I can imagine problems where either might be a reasonable choice. Yes, I can imagine that too. But there are also a very large number of problems where either one is a (much) better fit, and it would seem to me that that is the majority of problems, not of the 'toy' variety. The biggest factor in picking a language for a specific project is (in my opinion) availability of libraries and familiarity with the language by the team. Python scores very high for a large number of people in both those categories but it has been around for a while. Go is backed by one of the largest software companies on the planet so it stands a chance but google has a bad rep when it comes to cutting off projects in mid stride. The devil is always in the details with choices like these and without knowing more about a specific problem and the people that you intend to do the work with it is hard to say which one is the better fit beforehand.
- pjmlp 15y agoFor the type of applications people have been writing in Go, Python + PyPy would equally do as well.
- batista 15y agoOf course, you could do it, but why would you, almost every metric that you'd want to use would be off. You're comparing a compiled language with lightweight threads aimed at just-above-low-level programming backed by a single vendor with an interpreted language that is mostly geared towards single threads of execution with a very high level of expressiveness that is developed by a bunch of open source gurus under the supervision of a benevolent dictator. The development model (benevolent dictator/backing company) does not have anything to do with the comparison. The license is also orthogonal. Not sure why you are adding those to the table. The comparison I made is all about runtime behavior re: speed/memory usage here. And, what I am saying is that despite Go being static and compiled and touted as "very fast", it's slower in a lot of respects to EVEN plain old Python, not to mention Java, which runs circles around it. I'm not saying one would/should use Python and Go for the same tasks (though many people do, seeings as Go feels a little like a dynamic scripting language thanks to the easy syntax and the nice type system). I'm saying "Hey, isn't the basic reason for someone to use Go over something like, say, Python, that it's supposed to be faster and with better memory handling? How does that play in practice?".
- dhconnelly 15y agohttp://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=go&lang2=python3 http://shootout.alioth.debian.org/u64q/benchmark.php?test=al...
- Scaevolus 15y agoThe conclusion of that thread was that his Python benchmark was accessing the hashmap's entries in sequential order (due to python's hash function being intentionally non-random), while the Go benchmark was accessing keys at random (since its hash function is random) and trashing the cache.