which is why games like Doom in the 90s only had textured horizontal and vertical surfaces, no slopes.
So in each horizontal or vertical line of pixels you only need one division by z-distance, which can be optimised out of the loop
division is 20-40 CPU cycles. multiplication is 4. if you're dividing by the same constant in a loop, you're paying that tax a million times for no reason.
one reciprocal. computed once. everything else is multiplication.