bashANYimportsstartup
bash
python -v app.pyProfile Python programs, inspect memory and imports, and diagnose slow or stuck processes.
python -m cProfile -o profile.stats app.pyimport pstats
stats = pstats.Stats('profile.stats')
stats.sort_stats('cumtime').print_stats(30)import gc
print(gc.get_count())
print(gc.get_stats())import gc
unreachable = gc.collect()
print(unreachable)