cProfile  takes a while to learn how to use well.<p>What didn&#x27;t you like about line_profiler?<p>Here&#x27;s a good guide on how to write fast(ish) code in Python:
<a href="https:&#x2F;&#x2F;wiki.python.org&#x2F;moin&#x2F;PythonSpeed&#x2F;PerformanceTips" rel="nofollow">https:&#x2F;&#x2F;wiki.python.org&#x2F;moin&#x2F;PythonSpeed&#x2F;PerformanceTips</a><p>Generally, the best strategy for me has been to use NumPy wherever possible and to avoid creating many complex objects. Best to use built in dicts or tuples for things that store data.  Thus the only time I run into issues is when implementing algorithms in which case I usually isolate the slow function and turn it into a Cython module.
Recently have been playing around with <a href="https:&#x2F;&#x2F;github.com&#x2F;jboy&#x2F;nim-pymod" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jboy&#x2F;nim-pymod</a>  which seems like a much better solution.