[Tutor] filling 2d array with zeros

Dave Angel davea at ieee.org
Tue Sep 28 16:14:15 CEST 2010



On 2:59 PM, Alex Hall wrote:
> On 9/28/10, Steven D'Aprano<steve at pearwood.info>  wrote:
>> <snip>
>>
>> PyPy is a version of Python written in Python. It has an incredible
>> mission: to eventually produce versions of Python which are faster than
>> pure C, despite being written in Python itself. Although they have a
>> long, long way to go, they are making good progress, and PyPy can now
>> run Python code faster than CPython. PyPy is becoming a generalised
>> Just-In-Time compiler for high-level languages like Python.
> Okay, I now have to go investigate this and see how it is even
> possible; somewhere, the Python code has to get down to machine
> code...
>
Just-in-time compiling  (JIT) is taking some high-level construct, such 
as python byte code or a java class file, and compiling it into machine 
code, at the time of first execution.  Java uses it heavily, to achieve 
its performance level.  The standard CPython does not, but simply 
interprets those byte codes.

One advantage of just-in-time is that the translation can be specific to 
a particular processor, or even to a particular operating system and 
operating environment.  Conventional compiling is done by the developer, 
and he has to release multiple versions for multiple platforms.  And 
even then, he seldom takes advantage of the newer instructions of a 
given processor, which are changing quite frequently.  I'm sure there 
are at least a dozen different instruction supersets of the original 
Pentium processor, though most of the recent ones are relatively 
specialized (eg. for hashing, searching, encryption), and likely to 
affect libraries more than your main program.

DaveA



More information about the Tutor mailing list