Mailing List Archive

Is quotewords really this slow???
With a input data file of records read into an array of lines, I use
quotewords to break up the record into it's component fields, some
of which are quoted strings. The records are not long - 8 fields only.

I'm finding that it takes between .3 and .4 second *PER RECORD*!!!! This
seems so slow that I'm wondering if there is something wrong...

Here is a sample of the loop values before and after the calls.

$line[0] = $_;

@t = times;
printf ("Start_ %3d %6.2f %6.2f <p>",$i,$t[0],$t[1]);

@record = &Text::ParseWords::quotewords('\s+', 0, @line);

@t = times;
printf ("Parsed %3d %6.2f %6.2f <p>",$i,$t[0],$t[1]);

----
Start_ 0 2.95 0.85

Parsed 0 3.55 0.88
----
Start_ 1 3.57 0.88

Parsed 1 3.90 0.90
----
Start_ 2 3.92 0.90

Parsed 2 4.28 0.90
----
Start_ 3 4.30 0.90

Parsed 3 4.65 0.90
----

and so forth for several hundred lines...

The response pushes me well over the limit for human factors on this
application, so I need suggestions on how to get about a factor of
10 improvement in this section of code... (I can hear the moans of
people saying, riight.... yer jokin :-)

Suggestions???