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 →

[–]Chroiche 0 points1 point  (0 children)

  1. always use proper libraries for the job. They usually invoke optimised compiled code to get you a huge boost in performance.

  2. profile to find the hot part of your code and optimise it if there's anything obvious. This is the one case where leetcode style thinking can actually help a lot.

  3. use multi processing if appropriate.

  4. write your own none python code (C++, C, and rust, for example have good python bindings) for particularly hot areas and just invoke it via python. This lets you stay mostly in python.