Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: facts we will have to face ...

From: maksa:sezampro:yu at: 24-Oct-2001 9:27

Petr Krenzelok wrote:
>> btw: Could anyone enlighten me and describe, >> how Python solves such issue of interpreter speed?
From my experience - it doesn't. ;) A little story: I have a co-worker who is a Perl bigot when it comes to scripting, and we sometimes have language-pissing matches. But they're constructive, in a "talk-is-cheap, so-prove-whatever-you're-saying-by-writing-code" sense. We both learn in the process, so we don't feel so bad after all about doing what is realy a stupid thing - arguing about languages. Now, one of the matches was a task to write a fast and extensible cross-referencing program for web sites that the web part of the company is producing. The task was to find how many ADO VBScript constants are actually being used from the 12 Kb file included on almost every ASP page. He wrote his in Perl, I wrote mine in Python. His was the cleanest and most readable Perl code I've ever seen (but I should say that I haven't seen much Perl code, it's not easy on the eyes ;), and it was pretty damn fast. My Python code looked a lot better, but it was a *real* catastrophy when it came to performance. So I rewrote mine in Ruby while fully retaining the Python programs structure. Speed gain was incredible. Results: Ruby: 0.82 s Perl 3.50 s Python: 17.2 s Results are obtained after running each program several times to equalize their file caching opportunities, etc. This, of course, doesn't prove much, except that Python is way slower when processing files and doing string matching, and that Ruby had some clever speed tricks when it came to that. I'm sorry to say that my Rebol knowledge was (and probably still is, but I'm working on that) inadequate at the time to write the thing in Rebol. I think I'll go and do it now. Sorry if the whole post was an off-topic drag, but I just couldn't keep my mouht shut when I saw "Python" and "interpreter speed" in the same sentence. :) Regards, Maksa