Reducing Clock cycles to do a long calculation


I am performing a very long calculation in Arduino, and speed is very critical. The calculation is Bilinear interpolation.
Assuming all the variables are ints (2 byte), my question is how many clock cycles does it take to do a certain operation:


It's probably best to do a bunch of calculations (maybe a million or more) in a loop and time it.

The ATmega datasheet has a list of machine instructions listing the number of clocks for each, but (I assume) you are programming in C/C++ and it's probably not worthwhile to dig-into the complied machine language.


Assuming all the variables are ints (2 byte)

Of course, when you sum or multiply ints, the result may be bigger than an int. And with an 8-bit processor, bigger numbers take longer...

Is it essential to do the calculation on the Arduino or could it be done on a PC with data passed from the Arduino?


PC <-> Arduino communication is slow, maybe it will be slower than you actual Arduino code.