4 ms·
So, basically, write your code in Haskell, then, profile, and rewrite performance critical parts in C and hand-optimize them. Which means ... C has become the n
by Ace17 10y ago
So, basically, write your code in Haskell, then, profile, and rewrite performance critical parts in C and hand-optimize them.
Which means ... C has become the new assembly language!
- niccaluim 10y agoThey don't call C "portable assembly language" for nothin'. :)
- m_mueller 10y agoJust two things to add: 1) Often the "performance critical parts" are actually 60-80% of your code. This is the problem with the "don't optimize prematurely" philosophy. Think of it in advance instead. Do you need the highest possible performance? Are you sure? How fast should it be then? Per request? At setup? Per data point calculated? Choose your tools accordingly. 2) For numerical code I'd actually choose Modern Fortran over C. Much less to do until it's fast.
- mightybyte 10y ago> Often the "performance critical parts" are actually 60-80% of your code. That has not been my experience at all. But I suppose it depends on what kind of programs you're writing.
- m_mueller 10y agoI find that much of what I do is highly generic code, so it gets reused in all kinds of different places. That's when this happens. So for me this is the case, but yes, it certainly depends. I just want to warn people that the thinking of no premature optimisation can backfire.