RE: Top 5 Reasons to use Python
Yes I agree Python is slower natively, but there are some packages that make it more efficient. For example I am now using the NUMPY package by default for array manipulation.
I have tested it, the NUMPY package is about 60% faster than the default array structure. So that helps.
There are also tricks to speed up the code, for example in Python3 you don't need to transform a variable to float
, you just declare it like this variable=1.0
so that is automatically a float.
I have found that if you transform a variable into a float
with float(x)
command it might make it 50% slower.
I am doing research now with an intensive script I wrote, so believe me every bit of efficiency helps, but I guess I should try it in C too to see whether it will speed it up even more.