Vectorize Comparison of speed calculation in python by different methods (loops and vector operations)