in reply to Why are hashes so much faster?

Some of the speed differences may be due to the fact that the other program was written in C. In general, compiled languages (like C) are faster than interpreted languages (like Perl).

Replies are listed 'Best First'.
RE: Re: Why are hashes so much faster?
by Anonymous Monk on Jun 20, 2000 at 04:13 UTC

    As it happened, changing the script to use hashes made it considerably faster--so much so that it became almost as convenient to use as the C program. Actually, it became more convenient because I'd built better error-checking into it. The C program was content to try reading a binary file--of course, that'd generate an error--whereas the perl script refused to mess with binaries.

    In that regard, at least, I judged the script "ok"; and because it was no longer grotesquely slow, I could even (cautiously) consider it "better." Of course, if the C programmer beefs up the error-checking, then his app wins again. :)

      You know, you could post the code here and solicit suggestions to speed things up even further.

      It might be a fun little project...

RE: Re: Why are hashes so much faster?
by Anonymous Monk on Jun 19, 2000 at 19:13 UTC
    Yes, yes, yes - I find that Perl is faster to WRITE, not faster to execute (on a general basis).