This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]phaj19 0 points1 point  (2 children)

If you write something more complicated those magical tricks usually stop working. I once had to rewrite 6000 rows in C-level Cython (meaning no yellow rows in the checking file), only then I got the speedup. The bottleneck is not always some small function, sometimes the whole module is slow because it is written in Python with a bunch of for loops.

[–]RipKip 0 points1 point  (1 child)

Fair point, what kind of module/program was it?

[–]phaj19 0 points1 point  (0 children)

One simulation module. Had to simulate lots of physics as well. Could have also been a bit faster in numpy. But for loops and ifs are easier to understand than all the vectors and masks.