Slash Boxes
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.
More | Login | Reply
Loading... please wait.
  • Uh... (Score:4, Insightful)

    by jhi (318) <> on 2002.09.16 10:45 (#12881) Homepage Journal
    (As pointed out by many, already...)

    (1) The Perl code is really bad. Just replacing the "loop-over-each-line-recompiling-the-regex-each-time" by moving the loop invariant regex to the front of
    the while speeds things up.
    (2) Using qr speeds things up further.
    (3) Moving the sunIPs testing before the fileext
    testing speeds things up further.
    (4) Inlining the 192. and HTTP speeds things up.
    Hey, the Java code inlines those strings.

    And after all that is done, we're still comparing apples and oranges: the Java code doesn't do regular expressions. If someone has the time, they might want to ape precisely what the Java code is doing, using index() and so forth, and then measure that.

    I hope someone will write a polite expose of all the things that are wrong (*) with this article, and both post it to whatever forum/editors, and the author. Mind, be polite, professional, and helpful.

    (*) Let me see...
    (a) comparing apples and oranges
    (b) the Perl code not published in the article
    (c) the Perl code is very bad
    (d) the input data not available

    I won't comment on the Java code itself, I'll leave that to people who do more Java, except that noting that it inlines the filtering data, as opposed to the Perl code which at least has it cleanly separated into variable.