3 ms·
>On the plus side I know dozens of ways to refactor for legibility and 'accidentally' improve performance at the same time. My favorite is "That nested loop is
by HideousKojima 4y ago
>On the plus side I know dozens of ways to refactor for legibility and 'accidentally' improve performance at the same time.
My favorite is "That nested loop is kind of hard to read, how about making a dictionary/hashmap instead?"
- hinkley 4y agoI'll split this operation into a variable so it's easier to debug. Oh, now the variable is defined outside of the loop. How did that happen.
- touisteur 4y agoIf your compiler is not doing expression hoisting at -O2 in 2022, we should (collectively) ask for a refund (I know I'd be opening tickets since we pay for compiler support). Of course, very often, doing that often improves readability so it might still be a good use if your time.