8/16/32-bit operations performance
Posted: 20 Feb 2011, 23:42
Hi,
I want to do some signal processing. I'm trying to process a color sensor signal in real-time. The fastest I process my signal, the higher will be the sample rate.
I'm using NXC. I see that, using a signal of 100~200 samples and doing some memory accesses makes it very slow very easily. It's a pity not to take advantage from the maximum sample rate of the sensor readings.
If someone has tips about getting good performances, I will appreciate. Of course, getting into NBC would be a way, but I don't want to put so many efforts for now, to jump to NBC.
One simple thing I could do, is to change the variable types, to the fastest way the CPU can process them. Is there a big difference, or such a difference, between using char/unsigned char/short int/int/long ? I only need integer computations and 8bits is enough for the values I am processing.
Cheers,
Ricardo
I want to do some signal processing. I'm trying to process a color sensor signal in real-time. The fastest I process my signal, the higher will be the sample rate.
I'm using NXC. I see that, using a signal of 100~200 samples and doing some memory accesses makes it very slow very easily. It's a pity not to take advantage from the maximum sample rate of the sensor readings.
If someone has tips about getting good performances, I will appreciate. Of course, getting into NBC would be a way, but I don't want to put so many efforts for now, to jump to NBC.
One simple thing I could do, is to change the variable types, to the fastest way the CPU can process them. Is there a big difference, or such a difference, between using char/unsigned char/short int/int/long ? I only need integer computations and 8bits is enough for the values I am processing.
Cheers,
Ricardo