首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏数据科学(冷冻工厂)

    Python日学壹技:性能分析

    c+=1 10 21.492 MiB 0.000 MiB print c Mem usage: 内存占用情况 Increment: 执行该行代码后新增的内存 运行时间 line-profiler [2] 安装 pip install line-profiler 使用 在需要分析的函数上,添加装饰器@profile @profile def slow_function(a, b, c): function for display. ---- 参考资料 [1] memory-profiler: https://pypi.org/project/memory-profiler/ [2] line-profiler

    43820编辑于 2023-02-27
  • 来自专栏梅海峰的专栏

    Django 网站开发工具实践

    性能分析工具不够完善,基于cprofile开发的,缺少line-profile更细致的性能分析,如果能结合cprofile的功能定位出大致慢的函数,然后可以方便的用line-profiler定位具体慢的行

    1.7K00发布于 2017-08-18
  • 来自专栏TechFlow

    日拱一卒,麻省理工教你性能分析,火焰图、系统调用栈,黑科技满满

    下面这个例子展示了memory-profiler是如何工作的(注意装饰器和line-profiler类似) @profile def my_func(): a = [1] * (10 ** 6)

    92720编辑于 2022-09-21
  • 来自专栏Dechin的专栏

    使用line_profiler对python代码性能进行评估优化

    /site-packages (from traitlets>=4.2->IPython->line_profiler) (0.2.0) Installing collected packages: line-profiler

    3K10发布于 2021-05-21
领券