title: VB.NET: 2-dimensional list is almost 1000x slower than 1-dimensional list?
body: <p>Consider the following code:    </p>
  
  <pre><code>    Dim arr1 As New List(Of Double)
      Dim arr2 As New List(Of Object)
  
      Dim timeStart As DateTime = Now
  
      For x As Integer = 0 To 1000000
          arr1.Add(3.14159)
      Next
  
      Dim timeEnd As DateTime = Now
  
      MsgBox(((timeEnd - timeStart).Seconds).ToString())
  
      timeStart = Now
  
      arr2.Add(New List(Of Double))
  
      For x As Integer = 0 To 1000000
          arr2(0).add(3.14159)
      Next
  
      timeEnd = Now
  
      MsgBox(((timeEnd - timeStart).Seconds).ToString())
  </code></pre>
  
  <p>It involves 2 lists. The first one is 1-dimensional, the second one is 2-dimensional.</p>
  
  <p>The first routine (which operates on the first list) completes in about .015 seconds. The second routine (which operates on the second list), however, takes almost 10 seconds. The only difference is that the second list is 2-dimensional.</p>
  
  <p>Am I missing something here? Is there a way to speed this up or am I doing something wrong? I have a program that requires several 2-dimensional arrays and it's running extremely slow right now. How can I speed it up so I get the same feedback that I'd get if the lists were 1-dimensional?</p>