in my experience Int64 (native ints) are faster than anything else unless I 
need to keep an array in cache (eg a lookup table that's smaller than L1 
when I use Int8).

It's possible the code was slower because of conversions between different 
types (since not all values could be Int8) rather than the Int8 operations 
themselves.  Julia's automatic promotion probably doesn't help here: 

julia> typeof(0x1+0x1)
Uint64

Andrew


On Sunday, 30 March 2014 03:27:17 UTC-3, Freddy Chua wrote:
>
> Hi,
>
> I have a question. Suppose the data I have are only small integer values 
> in the range of 1-10. Should I use Int64 or Int8. Using Int64 would be 
> consistent with my system word size and would likely be faster. But using 
> Int8 would definitely save more memory.
>
> So, which should I use?
>

Reply via email to