[Jax.PM] ~9M lines of data

J Proctor jproctor at marlboro.edu
Mon Oct 14 15:36:38 CDT 2002


> In fact I vote Greg to be the Jax.PM Leader - Yeah Greg!

No way.  You're not getting out of it *that* easy, Sneexie.

I was going to ask why you don't watch for /^);/ (or index of it) instead
of the "dumping data" line, but it occurred to me that there might be
other lines with that, and you go through the process of setting $flag to
0 when it's already 0.

Didn't realize index() was that much faster, though.  Curious if you'd
like to try a version each way and report back.  Anchoring the regexes to
the beginning of the line (i.e. /^CREATE TABLE/ should be fairly well
optimized, and I *thought* (Greg, please correct me) that index() wasn't
context-aware enough to say the goal is to match at the beginning of the
line, if it doesn't, move on.  So one regex per line versus (length $_ -
length $target) flat comparisons doesn't seem like there'd be that much of
an advantage.

Never actually benchmarked it myself, but in this case, we know that
the exact string is "CREATE TABLE ", with actual Ascii 32 spaces; I can
imagine that \s *might* be a hair slower in a regex.


j





More information about the Jacksonville-pm mailing list