3 ms·
the implication performance ⇒ C++ is correct but the commonly assumed implication C++ ⇒ performance is not. Idiomatic Go can be faster than a mess of C+
by JulianMorrison 13y ago
the implication
performance ⇒ C++
is correct but the commonly assumed implication
C++ ⇒ performance
is not. Idiomatic Go can be faster than a mess of C++.
- ramchip 13y agoSomeone mentioned a while ago how a common pattern of comments on programming forums is to take the most literal and uncharitable interpretation of a post, and reply to explain how this extreme view is mistaken. I've never seen anyone defend the idea that writing something in C++ will necessarily make it high-performance and I would be very, very surprised if that's what the OP meant.
- diydsp 13y agowhat a coincidence- I was thinking about this this A.M. I was conceptualizing a flowchart. Something like: 1. Observation 2. Massive overgeneralization of observation and posting to Internet. 3. Refutation of massive overgeneralization. 4. Insistence on narrow range of circumstances in which observation is true. 5. Announcement of extraordinary exceptions. 6. Anecdote in which even that exception was inadequate. 7. Call for advanced structural frameworks to encompass vastly differing perspectives. 8. Recollection of failed attempt at structure in 1976 (Optional: suggestion to live in geodesic homes). 9. Platitudes about how the details don't matter anyway. 10. Violent exasperation that details won't matter, including extreme hypothetical circumstances. 11. Shifting of blame to political figures and/or youth and their gadgets.
- luikore 13y agoYeah, idiomatic any language can be faster than a mess of Go.
- zanny 13y agoWell written code in any language will almost always outperform poorly written code in another language. Python being 50x slower than C++ doesn't matter if you are using an exponential imlpementation of a linear problem.
- luikore 13y agoThat's what I meant. For most cases Go's performance over Python or even some messy C++ offers little use. But in some rare cases that we need to push the very limit of hardware, C++/C/assembly is more preferable than Go.
- craigyk 13y agoThe thing, IME, is that someone writing code in C++ is more likely to be aware that they are using an approach with suboptimal O. In a high-level language you can just as easily write a routine with bad O, especially if you don't understand the PL's underlying data structures. So then you get bad algorithm performance + bad Python performance.