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.
MDSN says that "In some cases, the common language runtime can pack your Short variables closely together and save memory consumption." but also that "The Integer data type provides optimal performance on a 32-bit processor"
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?
Thanks.
OutOfMemoryException
with integers? Otherwise use integers, a CPU is designed to work efficiently with 32-bit values. – Soapshort
, but actually measure the memory usage to see if it makes a difference. – Borlase