[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Speed: Parsing vs. Searching



Using U2's ITER function, I found some surprising results in terms of speed.
I wanted to extract names from a long comma-delimited string (Bill Jones,Mary Smith,John Doe, ...).
The two ways I know of to do this is by looping a parse (XS) or looping
with a SEarch for the comma and SaVing the results, as in .
I thought of the two ways as the memory-based way (XS) and the on-screen,
word-processing way (SE /,/). That made me assume that XS would be faster.
But it turns out that they are indistinguishable. If anything, SEarching is
a tiny bit faster.
But here's the amazing part: I got a TENFOLD speed increase by simply
removing the DeFined name after I had stored it. This meant the file
containing all the comma-delimited names, the file I was SEarching, got
progressively shorter, until it was empty at the end.
In accordance with GAXPP (generally accepted XPL programming practices), to
remove the DeFined block, I used function DN instead of RD.

Harry Binswanger
hb@xxxxxxxx