Cprofile中的Numba条目

发布于 2025-01-18 11:26:21 字数 380 浏览 1 评论 0原文

当使用 cprofile 分析代码时,我注意到出现了很多引用 numba 编译器的 numba 条目。我知道由于编译,第一次运行脚本时计算时间很长。

然而,所附的屏幕截图显示了应该编译的脚本中的 cprofile 条目(该脚本至少运行了两次,并且总计算时间也减少了)。

因为屏幕截图中显示的功能仍然消耗大量时间,所以我问自己使用 numba 是否做错了什么。此外,如果代码已经编译,则调用编译器函数是没有意义的。有没有办法找出已编译的函数是否已在存储中?在此处输入图像描述

When profiling code with cprofile, I noticed that there appear a lot of numba entries referring to the numba compiler. I know that the computation time is high at the first run of the script due to compiling.

The attached screenshot however shows cprofile entries from a script which already should be compiled (The script was run at least twice and also the total computation time decreased).

Because the functions shown in the screenshot still consume a lot of time, I asked myself if I do anything wrong using numba. Additionally, it does not make sense to call a compiler function if the code is already compiled. Is there a way to find out if compiled functions are already in storage?enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文