python simply not scaleable enough for google?

John Nagle nagle at animats.com
Sat Nov 14 23:41:49 EST 2009


Steven D'Aprano wrote:
> On Wed, 11 Nov 2009 16:38:50 -0800, Vincent Manis wrote:
> 
>> I'm having some trouble understanding this thread. My comments aren't
>> directed at Terry's or Alain's comments, but at the thread overall.
>>
>> 1. The statement `Python is slow' doesn't make any sense to me. Python
>> is a programming language; it is implementations that have speed or lack
>> thereof.
> 
> Of course you are right, but in common usage, "Python" refers to CPython, 
> and in fact since all the common (and possibly uncommon) implementations 
> of Python are as slow or slower than CPython, it's not an unreasonable 
> short-hand.

    Take a good look at Shed Skin.  One guy has been able to build a system
that compiles Python to C++, without requiring the user to add "annotations"
about types.  The system uses type inference to figure it out itself.
You give up some flexibility; a variable can have only one primitive type
in its life, or it can be a class object.  That's enough to simplify the
type analysis to the point that most types can be nailed down before the
program is run.  (Note, though, that the entire program may have to
be analyzed as a whole.  Separate compilation may not work; you need
to see the callers to figure out how to compile the callees.)

    It's 10 to 60x faster than CPython.

    It's the implementation, not the language.  Just because PyPy was a
dud doesn't mean it's impossible. There are Javascript JIT systems
far faster than Python.

    Nor do you really need a JIT system.  (Neither does Java; GCC has
a hard-code Java compiler.  Java is JIT-oriented for historical reasons.
Remember browser applets?)  If you're doing server-side work, the
program's structure and form have usually been fully determined by
the time the program begins execution.

					John Nagle



More information about the Python-list mailing list