some comments for Python 3000

Alex Martelli alex at magenta.com
Sun Aug 13 06:33:36 EDT 2000


"Ben Wolfson" <rumjuggler at cryptarchy.org> wrote in message
news:lpncpskqg038kfbnk8q23gjil5ml2h84qe at 4ax.com...
> On Sun, 13 Aug 2000 07:06:42 GMT, lobozc at my-deja.com wrote:
>
> >> I would make a wholesale switch to Python for all softare development
> >> if I could use it in performance-sensitive environments.
> >>
> >> It doesn't have to be as fast a C, mind you.
> >
> >I wouldn't mind Python being faster - for free :-). But if I need
> >something _running_ fast I'll use C++ - hard to beat. If I need a
> >scripting language I need to write the smallest number of lines of code
> >to get the result.
>
> I think his point was that if Python could run faster due to being
> compiled, then you would use it instead of C++--that would be a big boost
> in popularity, no?

I doubt the effect would be all that dramatic.  When I code 1000
components, their minimum acceptable performance for the task
will lie along some sort of bell-ish curve (maybe not a Gaussian,
but close enough).  The "hot" components for which I _have_ to
use C++ may be the top 10% or 20% of this, depending on the
kind of work one does.  Most C++ shops code far more C++
components than performance dictates would require (IMHO);
'performance-junkies', trying to extract the last ounce of cycles
at a micro-optimization level for components where it would make
no difference and/or much better performance enhancements would
be available by drastic rearchitecting (better done in Python).

Give me a magic-wand Python compiler that's able to reach, say,
50% rather than 10% of C++'s raw performance at a set of typical
tasks; and my C++ use might diminish, say, from 20-25% of the
components I write, down to 10-15%.  As I already, rationally, use
C++ as little as I can get away with it, the boost would surely not
be "big" at all.  It may be that some niche or other has a "lump" of
components requiring good-but-not-top performance, better than
what Python currently delivering but with no need to get all the way
down to C++'s all-out pedal-to-the-metal possibilities.  For those
rare shops specifically, the boost in Python usage might then be
"big" in this case -- but it would not be big in the overall context,
because those shops are few.

The *perception* of good performance may be an important
marketing concern.  But it's a marketing issue: from a technical
point of view, the actual importance of performance is minor
in this context.


Alex






More information about the Python-list mailing list