Originally posted by rakesh nagar:
Hi there,
I have a requirement for declaring an int constant. The value of constant is less than 10. I am using short datatype for storing this constant value.
Could you please tell me if there are some performance overheads of using short over int datatype.
Thanks & regards,
Rakesh Nagar
I would say yes, short will be slower. I think it is represented as an int in memory. But its still a short to the code. If you do any operations on it the result will be an int, which you will have to cast back to short. shorts basically require lots of casting, and I prefer not to use them in RAM, but they are preferred in storage if possible.