Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • it's slow. I wrote up a test script in Perl, Python and Ruby to do a regex search of a large text file. I'd post the numbers, but it would be ugly to look at. :) Long story short, Ruby was slowest of the three with execution times three times longer than Perl or Python. By the way, Perl was the fastest, but you knew that already. :)
    --
    Buck
    • Perhaps it depends upon how you wrote the program? From what was presented at the presentation, Ruby tends to be about 3% slower than Perl (whatever that means). If your program is running three times longer, I suspect that it's somehow due to the structure of the program. (unless, of course, there's something really funky about Ruby regexen that I am unaware of).

    • Show us the code and give us an example of the text file. That, or show the profiler results and I'll show you where/how you can optimize it (if possible).

      You're right, though. Perl is slightly faster than Ruby in most cases. This has mostly to do with interpreter startup time, but I think the Perl Development team also has simply had more time to tweak the C code. This is the sort of thing that will improve over time.

      Patches welcome. :)

      • Perl Development team also has simply had more time to tweak the C code

        Yes, that damned Perl Development team. They've done such a bloody good job of tweaking stuff already that I'm finding it very hard to get perl to go any faster. And the parrot folks are even worse - they're trying to get it fast as they design it, so that us retrofit tinkerers can't even squeeze any more out of it. :-(

        • Note that there has been some interest in and work put into the integration of parrot and ruby (named cardinal in the ruby community). That would remove (nearly all) the speed and library differences between perl and ruby.
      • Posted it all here [perl.org] for everybody's perusal. I expected Perl to be faster, but not by 3:1. I really hope it is something wrong on my part; I like Ruby a lot.



        Thanks,

        --
        Buck