[Jax.PM] ~9M lines of data

William C (Bill) Jones wcjones at fccj.edu
Mon Oct 14 16:07:00 CDT 2002


On 10/14/02 4:36 PM, "J Proctor" <jproctor at marlboro.edu> wrote:

> 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.

Yes, I found it faster to just let it get reset to false each trip.

> 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 code I wrote runs about the same as the code Greg wrote; although his
doesn't quite generate the data the way I want, but I am still trying to
break his more so mine will be much faster :)  What I want is -

CREATE TABLE ... (
Row
Row
Row
)

Then when I see Dump Data, the Flag become False so I can skip all the
INSERT INTO statements...

> 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.


Actually, recent Perl versions the RegEx and the Index (substr, rindex,
index) stuff - performance is about the same.

-Bill-  :]
_Sx____________________
  ('>    iudicium ferat
  //\   Have Computer -
  v_/_    Will Hack...





More information about the Jacksonville-pm mailing list