title: How is it possible that putting code in a separate function could increase performance?
body: <p>I have a mildly large function (about 80 lines of code without comments) that I'm optimizing.</p>
  
  <p>As part of trying to let the profiler do the work for me, I took 2 chunks of code and put them in separate functions (this is supposed to be only temporary until I can put them back in).</p>
  
  <p>The interesting part is this:
  My test case took 29.8 seconds<br>
  After I put the first chunk into a separate function I saw the small performance loss due to function call overhead. (30.2 seconds)
  When I put the second chunk of code into a separate function I got a pretty huge performance gain down to 24.2 seconds  </p>
  
  <p>The second chunk of code is an insertion into a rather large linked list which I plan to replace with a binary tree or something, but still this 20% improvement is pretty confusing to me.  </p>
  
  <p><strong>tl;dr: Trying to optimize code and noticed that putting block of code into separate function gave me a 20% performance increase.  How is that possible?</strong></p>
  
  <p>Edit: confirmed running in release build as well</p>