20 lines
471 B
Python
20 lines
471 B
Python
# -*- coding: utf-8 -*-
|
|
"""临时:拆解主进程 prof,看 501s 编译时间的分布"""
|
|
import pstats
|
|
import sys
|
|
|
|
prof = r"D:\Users\TermiNexus\Desktop\TransPyC\PROF\main_prof_64336.prof"
|
|
st = pstats.Stats(prof)
|
|
|
|
print("=" * 72)
|
|
print("主进程 Top 45 (cumtime, 含子调用)")
|
|
print("=" * 72)
|
|
st.sort_stats("cumulative")
|
|
st.print_stats(45)
|
|
|
|
print("=" * 72)
|
|
print("主进程 Top 30 (tottime, 真实 CPU)")
|
|
print("=" * 72)
|
|
st.sort_stats("tottime")
|
|
st.print_stats(30)
|