- Home /
Best Answer
Answer by DDP · Jul 08, 2014 at 05:10 PM
Well the short takes 16 bits of memory, while an int takes 32. But I think that the int will run faster as the CPU is designed to work with such values. It has to mask the first 16 bits to work with a short, which is a slight overhead.
Memory-wise though, a short will take half the space of an int. So if memory is a concern, a short may be interesting.
But honestly, I just like to stick with int. I don't think you will be optimizing anything noticeable in most situations by using a short.
Alright. I'll consider it when tackling memory issues. Thanks.