时间复杂度
实际工程
实际工程中有多个算法,可以通过分析工具分析
比如图中使用cprofile分析,分析可知第二行的东西调用了4次,一共耗时0.533s
使用方法
工具 | 分析方式 | 侵入性 |
---|---|---|
py-spy top | 基于采样的 实时性能分析 | 非侵入式 |
cProfile | 基于插桩的 全量统计 | 侵入式 |
实际工程中有多个算法,可以通过分析工具分析
比如图中使用cprofile分析,分析可知第二行的东西调用了4次,一共耗时0.533s
工具 | 分析方式 | 侵入性 |
---|---|---|
py-spy top | 基于采样的 实时性能分析 | 非侵入式 |
cProfile | 基于插桩的 全量统计 | 侵入式 |