title: Why the performance difference in += vs +?
body: <p>Debugging some code ended up testing the differences in the statements such as <code>$counter=$counter + 1;</code> vs <code>$counter+=1;</code></p>
  
  <pre><code>my $run=True;
  my $counter=0;
  my $sup=Supply.interval(1);
  my $tap= $sup.tap({
      $run=$_ &lt; 10;
  });
  {
      while $run {
          #$counter+=1;
          $counter=$counter + 1;
      }
      $tap.close;
      say "Iterations per second: {$counter/(now - ENTER now)}"; #
  }
  </code></pre>
  
  <p>I'm getting around 20% more iterations per second for <code>$counter=$counter+1</code> compared to  <code>$counter+=1;</code></p>
  
  <p>Whats happening in the background thats so different?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Interestingly when trying this with an array and hyper operators the performance is greatly  <em>increased</em> when using the <code>+=</code>.</p>
  
  <p>eg
  <code>@counter=@counter&gt;&gt;+&lt;&lt;@value;</code>
  vs
  <code>@counter&gt;&gt;+=&lt;&lt;@value;</code>
  I get about 2.8 times the iterations of the loop using <code>&gt;&gt;+=&lt;&lt;</code> with arrays of 10_000 elements.</p>
  
  <p>As far as I can tell via the <code>time</code> cmd there is minimal parallel execution in either case (total user + system is within 2% of real time). </p>
  
  <p>Any insight on how/why this is would be great. Thanks!</p>