I've used Scalene at various times in the past few years, and always liked using it when I want to dig deeper compared to cProfile/profile. You might also want to look at:

1] https://github.com/joerick/pyinstrument

2] https://github.com/benfred/py-spy

3] https://github.com/P403n1x87/austin

4] https://github.com/bloomberg/memray

5] https://github.com/pyutils/line_profiler

  • 1st1
  • ·
  • 5 hours ago
  • ·
  • [ - ]
For profiling memory consider far more advanced memray.

https://github.com/bloomberg/memray

Note: The Windows version currently only supports CPU and GPU profiling, but not memory or copy profiling.

That's a problem with many of the profiling tools around Python. They often support Windows badly or not at all.

Isn’t the modern Windows runtime just Linux anyway?
(Scalene author here) Nope, but WSL2 (Windows Subsystem for Linux) is, and Scalene works great with it.
This profiler was mentioned in the context of rewriting js tools in faster languages here:

https://lobste.rs/s/ytjc8x/why_i_m_skeptical_rewriting_javas...

The rewrite discussion is here: https://news.ycombinator.com/item?id=41898603

Oh! Lobsters is neat!