耐热玻璃的速度 [英] Pyrex speed

查看:71
本文介绍了耐热玻璃的速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人找到关于如何使用

pyrex加速代码的良好链接?我找到了各种信息,但重点通常不在于代码

加速。

解决方案

Jim Lewis schrieb :

有没有人找到一个关于如何使用
pyrex加速代码的良好链接?我找到了各种信息,但重点通常不在于代码
加速。




代码加速来自pyrex本身使用C,并使用

为此目的提供可用/编码的C函数的薄层。


Diez


< blockquote>我不打算编写C函数。我的理解是,通过在python代码中使用cdef来获得
,可以获得相当大的速度。我是

试图在更多

细节中找到如何修改python代码的描述,以便它在pyrex下快速运行。


在某些情况下你可以获得大幅度的加速,但Pyrex的主要点是易于包装,而不是加速。


根据你正在做的事情,在Pyrex中甚至在C中重写,使用直接使用Python / C API的
,可能不会给你带来太大的帮助。 />


Has anyone found a good link on exactly how to speed up code using
pyrex? I found various info but the focus is usually not on code
speedup.

解决方案

Jim Lewis schrieb:

Has anyone found a good link on exactly how to speed up code using
pyrex? I found various info but the focus is usually not on code
speedup.



The code speedup comes through the usage of C by pyrex itself, and using
it to put a thin layer over C-functions available/coded for that purpose.

Diez


I''m not planning to write C functions. My understanding is that by
using cdefs in the python code one can gain substantial speed. I''m
trying to find a description of how to modify python code in more
detail so it runs fast under pyrex.


You can gain substantial speed-ups in very certain cases, but the main
point of Pyrex is ease of wrapping, not of speeding-up.

Depending on what you''re doing, rewriting in Pyrex or even in C, using
the Python/C API directly, might not gain you much.


这篇关于耐热玻璃的速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆