How much memory does my Python code use? Memory Profiler!

Memory Profiler is an open-source module that uses the psutil module, to monitor the memory consumption of Python functions. It performs a line-by-line memory consumption analysis. Installation: Install Memory Profiler from PyPl using: pip install -U memory_profiler After you have configured memory_profiler, you can use a decorator to track the memory consumption of the function. The @profile decorator can … Read more

Python – How long does my code take to run?

Recently, I wanted to do some performance of my code. The following is what I’ve used to get some performance timing. The following is the code I’ve used. Run the code with the following: As we can see, the code took 8.3 seconds to run and the following is a breakdown of each module which … Read more