kavisek / demo-python-memory-profiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Memory Profiler

Description

This is a cool python package that show the memory usage of your script. This is super helpful when you are trying to optimize your data pipeline code.

Setup

poetry add memory_profiler matplotlib

You can run your script with the memory profiler by executing the following command. It will generate a .dat file with the memory usage information:

poetry run mprof run main.py

You can plot the data in the .dat file. The following command will generate a PNG file with the memory usage:

poetry run mprof plot

References

About

License:MIT License


Languages

Language:Makefile 59.1%Language:Python 32.2%Language:Dockerfile 8.7%