Oops! It went almost 20 percent slower by using Pyrex.
噢!使用Pyrex几乎慢了20%。
Our Glassware include Pyrex glass food container.
玻璃器皿包括高硼硅耐热玻璃保鲜盒。
Pyrex and heat-proof porcelain are fine but fragile.
耐热玻璃和耐热瓷器好虽好但又容易损坏。
Listing 10. Optimizing Pyrex-ized speed results for minting.
清单10. mint函数pyrex化优化后的速度结果。
Pyrex (the tool) processes ".pyx "files into".c "extensions.
py rex(工具)将“。py x”文件处理成“。c”扩展名的文件。
I need to take advantage of Pyrex variable declarations to get a speedup.
我需要利用Pyrex变量声明的优点来进行加速。
Pyrex is a language specially designed for writing Python extension modules.
Pyrex是一种专门设计用来编写Python扩展模块的语言。
In language terms, Pyrex is essentially just Python with type declarations added in.
按照语言的术语来说,Pyrex本质上是在Python中添加了类型声明。
This is essentially a tiny pit etched in silicon and sealed between two Pyrex wafers.
这基本上是一个很小的坑硅蚀刻和两高硼硅晶片密封。
For "normal" Pyrex users, however, there is no reason to modify the generated C module.
然而对于“普通的”Py rex用户来说,没有什么理由需要修改所生成的c模块。
Excitedly, I decided to see just how much speed improvement I got just by compiling via Pyrex.
令人兴奋的是,我决定来看一下只通过Pyrex编译可以怎样提高速度。
I have just declared some variable types that I clearly know, and I used the cleanest Pyrex counter loop.
我只声明了早已知道的一些变量类型,并使用最干净的Pyrexcounter循环。
In well-chosen cases, a Pyrex module can run 40-50 times faster than a Python version of the same module.
在仔细选择的情况中,Pyrex模块的速度可以比Python版本的相同模块的运行速度快40到50倍。
On the other hand, a C or Pyrex int variable is just a region in memory with some bits set to ones or zeros.
另外一方面,C或Pyrex 的int变量只是内存中各个位设置为1 或 0 的一个区域。
Place the dried porcini mushrooms in a bowl or a Pyrex measuring cup, and pour on two cups boiling water.
将脱水牛肝菌置于一只碗或一只耐热量杯中,然后倒进两杯开水。
The study suggested that using single fining agent couldn't satisfy the fining require of Pyrex flat glass.
研究表明,单一澄清剂无法达到高硼硅平板玻璃澄清的要求。
Of course, when you start talking about making Python (-like) modules fast, Pyrex is not the only tool there is.
当然,当您开始谈论加速(类)Python模块时,Pyrex并不是惟一可用的工具。
Because the module runs slowly, maybe Pyrex would be a good candidate for speeding it up. At least that was my thought.
由于这个模块的运行速度很慢,可能Pyrex会是一个比较好的加速方法。
In particular, to use Pyrex, you write functions in a Python-like language that adds type-declarations to selected variables.
特别地,要使用Pyrex,需要用类似python的语言编写函数,这种语言将类型声明添加到所选变量中。
The figure to look at is the "hashes per second," which pretty reliably measures speed. So comparing native Python with Pyrex.
我们要看的内容是“hashes per second”,它可以精确可靠地测量速度。
For example, the Pyrex home page prominently features a numeric-intensive function for calculating a list of initial prime Numbers.
例如,Pyrex主页上使用一个计算素数列表的数学函数来宣扬这个特性。
The coverage of numeric is certainly not identical to those functions that can benefit from Pyrex, but there is certainly some overlap.
尽管numeric的涵盖面当然与可以利用Pyrex 的函数不同,但是肯定会有一些重叠。
Code that spends most of its time making library calls is just not going to benefit that much from Pyrex speeding up incidental loop overhead.
花费大部分时间在库函数调用上的代码不会像那些简单循环任务一样使用Pyrex可以获得明显的加速。
If a Python application encounters a significant bottleneck in numeric functions, creating Pyrex versions of those functions is very sensible.
如果Python应用程序碰到数值函数方面的明显瓶颈,为这些函数创建一个Pyrex版本就非常有意义。
The reason you actually want to use Pyrex, however, is to write modules that run faster -- maybe a lot faster -- than pure Python can possibly run.
然而,您真正希望使用Pyrex的原因是它编写的模块比纯Python运行得更快,可能会快很多。
For code that works with simple numeric or character data in tight loops, Pyrex can produce significant speedups, maybe 50 times the speed in best cases.
对于在循环中使用简单的数字或字符数据的代码来说,Pyrex的加速效果非常明显,在最佳情况中,可能会是50倍。
Instead he recommends using glass such as Corning Ware Pyrex or ceramic containers for heating food. You get the same results only without the dioxin.
他建议加热食品要用玻璃,如康宁餐具,高硼或陶瓷容器,这些容器没有戴奥辛是健康的。
Another option to think about, however, in writing specialized numeric functions using Pyrex is whether Numerical Python might be a suitable tool for your work.
然而,在使用Pyrex编写特殊的数值函数时,另外一个需要考虑的选项是是否可以使用NumericalPython作为工具。
Moreover, in many cases, a generic two lines enabling Psyco can produce an improvement similar to what you get though a moderate degree of rewriting from Python into Pyrex.
而且,在很多情况中,增加两行代码启用Psyco 就可以达到将Python 代码中度修改为Pyrex所能达到的加速效果。
You can distribute binary Pyrex modules, but for your module to work elsewhere, you must match the Python version, architecture, and optimization flags that the end user needs.
虽然您可以分发二进制的Pyrex模块,但是为了能使您的模块在其他地方也可以运行,Python的版本、架构和终端用户需要的优化选项必须匹配。
应用推荐