title: VBScript (classic ASP) Performance - Store string length in a temporary variable in a loop
body: <p>I would like to know if the performance is better in case I am storing the string length
  in a temporary variable when I am using a loop of at list 10,000 loops instead of calculating it in every loop?</p>
  
  <p>Code example calculating the string length:</p>
  
  <pre><code>'--
  Dim I
  Dim str : str = "Lets say this string length is around 50,000"
  '--
  For I=0 To 100000
      Response.Write Len(str) &amp; "&lt;br&gt;"
  Next
  </code></pre>
  
  <p>Code example using a temporary variable:</p>
  
  <pre><code>'--
  Dim I
  Dim str : str = "Lets say this string length is around 50,000"
  Dim temp : temp = Len(str)
  '--
  For I=0 To 100000
      Response.Write temp &amp; "&lt;br&gt;"
  Next
  </code></pre>
  
  <p>What do you think is better?</p>
  
  <p>Thanks!</p>