I have a library I use to decode the rows of a table from a page of HTML text.
This routine seems to be a bottleneck from a speed standpoint. It is taking 2 seconds per table row to extract the 15 items from the row text. I'm using TextCommands and regex expressions to do the parsing of the HTML data.
So I'm trying to determine how I can speed this routine up, as I call it from several different scripts.
My question is, I think, one of best syntax.
Which would be faster:
set allHTML to "<[^<>]+>" set StoryRecord to {} tell application "TextCommands" set c1str to "<td class=\"x1\">.*?</td>" set Column1 to search RowText for c1str with regex set file_num to search Column1 for allHTML replacing with "" with regex set MyRecord to MyRecord & {file_num} -- item 1 ... end tell -- TextCommands
or
set allHTML to "<[^<>]+>" set StoryRecord to {} set c1str to "<td class=\"x1\">.*?</td>" tell application "TextCommands" set Column1 to search RowText for c1str with regex set file_num to search Column1 for allHTML replacing with "" with regex end tell -- TextCommands set StoryRecord to StoryRecord & {file_num} -- item 1 ...
Does it matter, from a speed standpoint, to only put statements in a tell block that are targetted to that application?
Jim Brandt
|