- flame graph, 火焰图,cpu调用频率
https://github.com/evanhempel/python-flamegraph
python -m flamegraph -o perf.log myscript.py --your-script args here
https://github.com/brendangregg/FlameGraph
flamegraph.pl --title "MyScript CPU" perf.log > perf.svg
- 耗时
http://stackoverflow.com/questions/582336/how-can-you-profile-a-python-script
python -m cProfile -s time mine.py <args>
参考
http://stackoverflow.com/questions/582336/how-can-you-profile-a-python-script https://wiki.python.org/moin/PythonSpeed/PerformanceTips#Profiling_Code