Archive | optimization RSS feed for this section

Optimization tip: reduce the amount of code to execute

21 Jul

Reducing the amount of code to execute is not always the work of the compiler, the person writing the code has to be conscious of how the code will end up in instructions in order to obtain optimized binary code.

Continue reading

Optimization tip: don’t use sqrt when comparing distances

7 Jul

When comparing distances, whether it be for collision detection in games or drawing circles or discs (like in this recent Geeks3D post) I often see people using sqrt when they are comparing distances. This sqrt is not needed and only wastes CPU or GPU time.

Continue reading