推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
DaChuiZi
V2EX  ›  Python

有没有开源的工具对 Python 运行的类或函数 性能时间分析的工具

  •  
  •   DaChuiZi · Dec 16, 2022 · 3102 views
    This topic created in 1268 days ago, the information mentioned may be changed or developed.

    由于自己写的程序,部分函数 耗时较长,想统计一下哪些函数比较耗时,如果用 time 模块还得打印 print 也比较耗时,所以有没有开源的工具可以分析啊~

    7 replies    2022-12-19 11:48:02 +08:00
    zxCoder
        1
    zxCoder  
       Dec 16, 2022
    profiler
    line_profiler
    sujin190
        2
    sujin190  
       Dec 16, 2022 via Android
    不是有 profile 么,标准支持,生成火焰图可能需要其它库
    ClericPy
        3
    ClericPy  
       Dec 16, 2022
    随手一搜不是很多么...

    Python 程序调试分析大杀器 - 知乎 - https://zhuanlan.zhihu.com/p/505344229
    lithiumii
        4
    lithiumii  
       Dec 16, 2022
    VizTracer ?
    z4oSkDNGGC2svsix
        5
    z4oSkDNGGC2svsix  
       Dec 16, 2022
    python 标准库自带 cprofile, 结果是二进制文件, 可以用自带的 pstats 查看结果.

    ```
    python -m cProfile -o script_stat.prof my_script.py
    python -m pstats script_stat.prof
    ```
    penguinWWY
        7
    penguinWWY  
       Dec 19, 2022
    个人最喜欢用的是 py-spy
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2913 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 02:57 · PVG 10:57 · LAX 19:57 · JFK 22:57
    ♥ Do have faith in what you're doing.