Horrible Code, Clean Performance
I have long been in the habit of leaving in the old pre-optimized code, commented out, above the optimized code. I generally don’t think that performant code ends up all that mangled, but it costs ~nothing to leave the old code in a comment.<p>I picked this practice up from an older engineer who would set<p><pre><code>    SLOW = false 
</code></pre>
at the top of the file and then wrap old code in a<p><pre><code>    if (SLOW) { … }
</code></pre>
block for the compiler to do dead code elimination on. (I found linters and compilers complained less about commented-out code, but he preferred his way so it would always have syntax highlighting.)