3 ms·
You missed the point: I did not had to change data structure to get the speedup.
by jfpuget 11y ago
You missed the point: I did not had to change data structure to get the speedup.
- dr_zoidberg 11y agoI aknowledged it, see the "Edit" at the end ;) In your case reaching to numpy was probably the best you could do, as it abstracts and solves many things. Using properly "vectorized" numpy is also a big plus for readability. I just wanted to mention a few things regarding the "pure python optimization" views which could help in cases where you're not writing numerical code that won't benefit from numpy.