0

My code is running really slow (~10 mins for millions of data points) and instead of physically stepping through the code, can I have PyCharm highlight the current line of code that it is running so I can see where it is spending the majority of its time?

Stepping through the code took too long since there are many lines of code and many files to view.

BigBen
  • 46,229
  • 7
  • 24
  • 40
  • use pycharm debugger – sahasrara62 May 02 '23 at 20:19
  • 3
    Profile the code. This can be done with the paid version of PyCharm. Otherwise, try [`cProfile`](https://docs.python.org/3/library/profile.html#module-cProfile). You can look at my [answer](https://stackoverflow.com/a/60941705/4583620) for an example of how to use it. – Michael Ruth May 02 '23 at 20:27
  • I would suggest checking [jetbrains doc for stepping through the program](https://www.jetbrains.com/help/pycharm/stepping-through-the-program.html). – Memristor May 03 '23 at 01:52

0 Answers0