It's probably irrelevant, but I just spent half an hour writing an explanation why you may want to calculate the squared length of a vector, which goes roughly like this:
lengths are calculated by the Theorem of Pythagoras, which involves three squares and one root operation
for length comparisons, you do not need the exact length but can work with the sum of the squares, because a²<b² --> a<b for positive a,b.
so you may want to go without the expensive root operation in the length calculation and compare the squares instead.
That sounded all nice and logical, but when I did a test with actual timestamps, GetLengthSquared did not save me any time in comparison with GetLength. On the average, the function was actually slower! That makes very little sense, as it should do less.
Can someone tell me what GetLengthSquared actually does internally that needs more time than GetLength? And if it does, why does it exist in the API? What issue is it meant to solve?
Or is this just a Python thing? Interpreter needs more time to find the function... whatever...