title: Efficient code: short vs integer data types in VB.Net
body: <p>I'm writing an application where performance is fairly critical. I'm a bit confused as to which is the most efficient data type for x64 CPUs. </p>
  
  <p>MDSN says that <a href="https://msdn.microsoft.com/en-us/library/7tb7bdw6.aspx" rel="nofollow noreferrer">"In some cases, the common language runtime can pack your Short variables closely together and save memory consumption."</a>  but also that <a href="https://msdn.microsoft.com/en-us/library/06bkb8w2.aspx" rel="nofollow noreferrer">"The Integer data type provides optimal performance on a 32-bit processor"</a></p>
  
  <p>I'm using a huge amount of data (average around 5 million values in a jagged array[10 or more][30][128,128]) to generate bitmaps in real time (heat maps of the data values). All of the data points are whole numbers between 200 and 3500 so I can use short or integer. Which would be most efficient?</p>
  
  <p>Thanks.</p>