[Tutor] Python Advocacy

Remco Gerlich scarblac@pino.selwerd.nl
Sun, 15 Apr 2001 03:55:30 +0200


On  0, Sheila King <sheila@thinkspot.net> wrote:
> PK> How Python being compiled to bytecodes would give it a speed advantage
> over Perl, which is
> PK> also compiled to "bytecodes" which are then interpreted, is beyond me.
> 
> I just am not qualified to respond to these types of remarks. Is anyone here
> game?

"PK" is being clever. His point is that Perl is byte-compiled as well.

Saying "How this is a difference is beyond me" is c.l.perl.misc talk for
"I'm sorry, but you were inaccurate there, there is no difference."

> He further states:
> 
> PK> Speed is often not a BIG issue: if a script in Perl takes 1 minute and in
> Python
> PK>it took 1 and a half minutes, that's really not going to be an issue most
> of the time. If a Perl
> PK> script that runs in 1 minute takes 20 minutes in Python, that may well be
> an issue: and it's a
> PK> possibility too. http://home.hiwaay.net/~gbacon/py-vs-pl.html (It's from
> 1995: I assume Python
> PK> has gotten considerably faster since then. The point is that it most
> certainly COULD be that
> PK> scale of difference, not that it IS.)
> 
> Then he proposes a challenge: Some task, where the Perl fans will write their
> idiomatic solution, and the Python fans (me? I don't know that there is anyone
> else there), will write their solution. And then they'll benchmark it.

His first point is good. Perl and Python are both slow compared to typically
fast languages (say, C). So if you're going to use one, it's not going to
matter if one is slightly slower than the other. If one is going to be
substantially slower (like a factor 20) then it matters, for that application.

>From what I've seen, most huge differences between Perl and Python were
caused by incompetence in the slower language. Some idiom in Perl was
translated too directly to Python or vice versa. There's often a better way.

Still, such a challenge would be reasonable, if it were to use a lot of
different problems. I don't know what his challenge was about, url?

-- 
Remco Gerlich