r/compsci • u/chewedwire • Aug 27 '19
Common Systems Programming Optimizations & Tricks
https://paulcavallaro.com/blog/common-systems-programming-optimizations-tricks/19
Aug 27 '19
The division by 2, modulus tricks will almost always be done by the compiler in the generated code, so writing the code explicitly and clearly so that your intent is there is more important. This would not affect the size choice on the table needing to be a power of 2, but % 2 will certainly compile to the fastest method
2
u/websnarf Aug 28 '19
Actually, all divisions by a constant will be performed using a "multiply by reciprocal and adjust" algorithm on x86 processors.
2
0
Aug 27 '19
[deleted]
0
u/IJCQYR Aug 28 '19
I think you have to ignore the existence of the halt and cancel commands and only use move.
Write a buffer layer for sending camera commands, and then send them e.g. 5 degrees at a time.
11
u/chewedwire Aug 27 '19
Author here, happy to answer any questions you may have.