An excellent example. This is also one of those things that is hard to profile away, because it essentially leads to a very flat profile because you&#x27;re probably forgetting to use with_capacity()&#x2F;reserve() <i>all over the place</i> not just in single very-costly cases[1]. So you end up wasting, say, 1% CPU time all over the place... add up enough of these time-wasters and soon you&#x27;re going to be wasting significant amounts of CPU time for no good reason.<p>Obviously, this kind of thing isn&#x27;t a magic bullet, but in general I&#x27;d say the key for any kind of program is to express your <i>intent</i> at the highest level possible. This benefits both optimization <i>and</i> human readers! (That obviously means that the programming language must <i>support</i> such abstraction in a non-leaky way.)<p>[1] Which <i>would</i> show up prominently on a profile.