Is it counter-productive to pass primitive types by reference?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4112914/is-it-better-to-pass-by-value-or-by-reference-for-basic-datatypes">Is it better to pass by value or by reference for basic datatypes?</a><br>
  <a href="http://stackoverflow.com/questions/10770410/reasons-to-not-pass-simple-types-by-reference">Reasons to not pass simple types by reference?</a>  </p>
</blockquote>



<p>I did some testing where I had two scenarios, each with two identical functions- one passing the parameter by reference and the other by value. The scenario with strings showed a massive performance increase (because a copy of string is made, calling a constructor) whereas the test with long didn't show any performance increase when passing the value by reference. In fact, sometimes the performance was worse.</p>

<p>Is this expected with primitive types? Is there no point passing them by reference?</p>

<p>I was expecting a copy of a primitive type is made when not using by reference and therefore expected a small performance-boost.</p>
