Will multithreading make python less popular?

Steve Holden steve at holdenweb.com
Fri Feb 20 00:45:30 CET 2009


Paul Rubin wrote:
> Tim Rowe <digitig at gmail.com> writes:
>>> That Python is so much slower than C is yet another area where Python
>>> can use improvement.
>> No, because we don't use Python where C would be more appropriate.
> 
> C is basically never appropriate.  C should be outlawed by Congress
> with the ban enforced by roving pie-throwing squads <wink>.  If a
> Python program is too slow, making Python faster is far preferable to
> switching to C.
> 
Unfortunately it's also far more difficult. I speak with the experience
of the "Need for Speed" sprint behind me: the accumulated brainpower at
that event should have been able to pick all the low-hanging fruit, and
yet the resultant net speedup was worthwhile, but definitely not immense.

>> Sure nobody would complain if Python were faster, but it's not for
>> speed that we choose Python. Not speed of /execution/ that is.
> 
> I would say, slow execution is a drawback that we put up with in order
> to gain benefits of Python programming that are mostly unrelated to
> the causes of the slowness.  The slowness itself can be addressed by
> technical means, such as native-code compilation and eliminating the
> GIL.  I believe (for example) that the PyPy project is doing both of
> these.
> 
And IronPython and JPython already have. (How many times do I have to
say this before somebody with access to decent multi-processor hardware
runs some actual benchmarks?  Where's snakebite.org when you need it? ;-)

>> Different languages have different trade-offs. Python's trade-offs
>> suit us. If they don't suit you, use a language with trade-offs that
>> do.
> 
> I don't think Python's slowness is inherent in the language.  It's
> mostly a shortcoming of the implementation that should be fixed like
> any other such shortcoming.

Reasonable, and true. Some people talk about the GIL as though it were
something other than an implementation artifact.

What Guido doesn't seem to have accepted yet is that slowing [C]Python
down by 50% on a single-processor CPU will actually be a worthwhile
tradeoff in ten years time, when nothing will have less than eight cores
and the big boys will be running at 64 kilo-cores.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list