Even if you&#x27;re right. The issue with coding to optimizations is that it&#x27;s really, really brittle. You change the position of a variable and suddenly your application runs 10x slower.<p>Why ? Because it just went from O(N) with no allocations to O(N^2) because it has to constantly extend and walk a list (the free memory list, which is lower bounded by the number of iterations of the loop) on every iteration of the loop (malloc is O(N), so calling malloc in a loop automatically increases it&#x27;s complexity, and compilers change stack allocations into mallocs due to optimizations).<p>I&#x27;ve seen this happen many times. And then, after 2 weeks of searching you find the cause : someone changed 3 * i into i * 3 in a method which caused autoboxing to suddenly actually occur.<p>Counting on compiler optimizations to save your ass is incredibly, incredibly brittle.