psyco
- n.Python 语言的一个扩展模块
-
The current article utilizes that neural network code to demonstrate Psyco 's capabilities .
现在这篇文章利用了其中的神经网络代码来演示Psyco的功能。
-
After a little playing around , I established several details about how to use Psyco .
使用了一段时间后,我建立了有关Psyco用法的一些详细信息。
-
As magic as Psyco is , using it still requires a little thought and testing .
尽管Psyco如此神奇,使用它仍然需要一点思考和测试。
-
More significantly , however , it is important to understand the scope of Psyco binding .
然而,更值得注意的是要理解Psyco绑定的作用域,这一点很重要。
-
In other words , Psyco does almost as much with just two generic lines of code .
换而言之,Psyco之不过添加了两行通用的代码,就几乎能实现相同的目标。
-
Psyco replaces the eval_frame () function with a compound evaluation unit .
Psyco用复合求值单元替代evalframe()函数。
-
The Psyco module is an often-missed way to increase the speed of Python applications with minimal work .
Psyco模块常常被忽略,但是它可以通过较少的工作提高Python应用程序的速度。
-
In almost all cases other than testing and debugging , the psyco . bind () form is what you will use .
除了测试和调试之外的几乎所有的情况下,您都将使用psyco.bind()形式。
-
The real savings in Psyco , however , arise from Psyco 's categorization of operations into three different levels .
但是,Psyco中真正省时的原因在于Psyco将操作分成三个不同的级别。
-
It is far better to selectively bind those functions that can benefit most from Psyco 's optimizations .
有选择性地绑定那些可以从Psyco的优化中获得最大收益的函数,这样会好得多。
-
As of right now , Psyco is only available for i386 CPU architectures .
到现在为止,Psyco只可用于i386CPU体系结构。
-
Psyco has a large memory overhead which might even negate any gains if the machine has to go to swap .
Psyco需要很大的内存开销,如果机器进入交换,它甚至会抵销Python获得的任何性能。
-
Psyco : Learn more about this Python extension module that can massively speed up the execution of Python code .
Psyco:了解有关这个Python扩展模块的更多信息,它可以显著提高Python代码的执行速度。
-
Psyco currently does not perform any sort of internal statistics or profiling , and does only minimal optimization of generated machine code .
Psyco现在不执行任何类型的内部统计或概要分析,只对生成的机器码进行最小优化。
-
On the first pass , all I did was add psyco . jit () to the top of my script .
第一遍测试中,我所做的就是将psyco.jit()添加到脚本顶端。
-
Aside from creating i386-specific codes for small operations , Psyco caches this compiled machine code for later reuse .
除为小型操作创建特定于i386的代码之外,Psyco还高速缓存这个已编译的机器码以备今后重用。
-
I have a hunch , however , that I might be able to improve Psyco 's speed by fiddling with some algorithm details .
然而,我有一些程序可以通过修改一些算法的细节来提高Psyco的速度。
-
For a more relevant test of Psyco , I dug up some neural network code that I had written about in an earlier article ( see Resources ) .
为进行更恰当的Psyco测试,我搜寻出我在以前的文章里编写的一些神经网络代码(请参阅“参考资料”)。
-
In addition , perhaps a future Psyco could decide to perform more extensive ( but more costly ) optimizations on heavily-run operations .
另外,也许今后的Psyco可能会决定对费力运行的操作进行更广泛(但也更昂贵)的优化。
-
Psyco to keep it very short is a just-in-time ( JIT ) compiler of Python code into ( x86 ) machine code .
Psyco可以保持代码非常简短;它是(x86)机器代码中的一个JITPython代码编译器。
-
Compile-time variables are represented in machine registers and directly-accessed memory locations , once the operations have been compiled by Psyco into machine code .
一旦Psyco将操作编译成机器码,那么编译时变量就会在机器寄存器和可直接访问的内存位置中表示。
-
The nice thing about Psyco is that you can use the very same Python code you have been writing all along ( literally !), but let it run much faster .
Psyco的妙处在于可以使用您一直在编写的Python代码(完全一样!),却可以让它运行得更快。
-
To understand Psyco completely , you probably need to have a good grasp of both the Python interpreter 's eval_frame () function and i386 Assembly .
要完全理解Psyco,您可能需要很好地掌握Python解释器的evalframe()函数和i386汇编语言。
-
But while the Python interpreter is running an application , Psyco sometimes checks to see if it can substitute some specialized machine code for regular Python bytecode actions .
但是当Python解释器运行应用程序时,Psyco会不时地检查,看是否能用一些专门的机器代码去替换常规的Python字节码操作。
-
Call , I added only the line psyco . bind ( main ), since the main () function does loop a number of times ( but only makes minimal use of integer arithmetic ) .
我只添加了psyco.bind(main)这一行,而不是添加一个总的psyco.jit()调用,因为main()函数确实要循环多次(但是仅利用了最少的整数运算)。
-
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所能达到的加速效果。
-
Unlike Pyrex , Psyco does not exactly type variables but rather creates several speculative machine code versions of each Python block based on each hypothesis about what the data types might be .
与Pyrex不同,Psyco并不会精确地限定变量的类型,而是根据数据可能是哪种类型的每种假设为每个Python代码块创建几种可能的机器代码。