4 ms·
Optimizing like this in python is clearly the wrong approach. Python will never be fast in the traditional sense. The only optimization you should be worrying
by algorias 17y ago
Optimizing like this in python is clearly the wrong approach. Python will never be fast in the traditional sense.
The only optimization you should be worrying about is avoiding quadratic behaviour and such, which usually accounts for 99% of all inefficiencies.
If you really need speed, move the code to C and call it from python.