Debugging and profiling¶
這些函式庫幫助你進行 Python 程式開發:除錯器允許你在程式碼中單步 (step) 執行、分析堆疊框 (stack frames) 以及設置中斷點 (breakpoints) 等,效能分析工具執行程式碼並提供關於執行時間的詳細分析,讓你找到程式中的瓶頸 (bottlenecks)。事件稽核 (auditing events) 提供執行時期行為的可見性,否則的話可能需要更侵入性的除錯或修補。
- 稽核事件表
bdb--- 偵錯器框架faulthandler--- 傾印 Python 回溯pdb--- Python 偵錯器profiling--- Python profilers- Introduction to profiling
- Choosing a profiler
- Quick start
- Understanding profile output
- Legacy compatibility
pstats--- Statistics for profilerstimeit--- 測量小量程式片段的執行時間trace--- 追蹤或追查 Python 陳述式執行tracemalloc--- 追蹤記憶體配置