Comparing perl and python

Mridul mridulj at newgen.co.in
Wed Feb 23 02:13:37 EST 2000


 Here's something to chew on as far as speed is concerned:

 Python2C
    More recently, Bill Tutt and Greg Stein developed Python2C. This
    translates Python to C code. Mostly, the C code ends up manipulating
    PyObjects in much the same way as if you had recreated the Python code
    in C using the high level Python / C API. That is, you'll get a speed
    up from the fact that there's no byte-code interpreter loop, but
    that's less than most people expect. (There's been a lot of talk about
    global program analysis and type deduction. When these ideas bear
    fruit, more dramatic speed ups will become possible.)


 By the way has anybody used it?????????If so please give us a feedback and
 from where to download it from........







>
>
>
>
>
>
>
> Aahz Maruch <aahz at netcom.com> wrote in message
> news:88vtfj$egl$1 at nntp6.atl.mindspring.net...
> > In article <his6bs08biqdkasl8cis6t9bk6pfd5onc0 at 4ax.com>,
> > Tim Roberts  <timr at probo.com> wrote:
> > >
> > >It's clear that there is a substantial library of modules for python,
> > >approaching that of perl.  However, I am disturbed by what seems to be
a
> > >dramatic performance difference.  I've tried writing some simple test
> cases
> > >in both languages, and I'm finding python to be 2x, 3x, and in one case
> 12x
> > >slower than the equivalent program in perl.  (The 12x case was a simple
> > >"grep the files in stdin", using the "re" and "multifile" modules in
> > >python.)
> >
> > In raw speed, Perl tends to run about twice as fast for the most
> > "obvious" way to do things.  This advantage spreads to 5x or 10x when
> > you talk about the "obvious" way to do certain kinds of I/O.
> >
> > The advantage diminishes rapidly when you compare the code of expert
> > programmers, and it mostly vanishes when you start looking at real,
> > complex programs.  Main reason for that is that Python code is so much
> > easier to write, you spend more time looking at the algorithms -- that's
> > where you get your order of magnitude increases in performance.
> >
> > Remember that Perl is optimized to be a "super AWK".  And IMO, that's
> > about all it's good for.
> > --
> >                       --- Aahz (Copyright 2000 by aahz at netcom.com)
> >
> > Androgynous poly kinky vanilla queer het    <*>
> http://www.rahul.net/aahz/
> > Hugs and backrubs -- I break Rule 6
> >
> > Love does not conquer all.  Humans are extremely flexible, usually more
> > flexible than we're willing to admit.  But some flexibility comes at a
> > cost, and sometimes that cost is more than we can bear.
> > --
> > http://www.python.org/mailman/listinfo/python-list
>
>
>





More information about the Python-list mailing list