in reply to Re^2: Need Speed:Search Tab-delimited File for pairs of names
in thread Need Speed:Search Tab-delimited File for pairs of names
The journey to a better program (for some definition of 'better', in this case faster) begins with a program that works and that one can understand. As suggested elsewhere, the OP code is a spaghetti monster that dare not enable strictures and warnings lest it reveal a host of naughty practices and lurking bugs.
kcott's shorter and cleaner code, assuming it actually does what mnnb wants, is much more likely to be a good starting point for improvement. I haven't studied it closely, but it seems to me that the regexes, if insufficiently speedy, could fairly easily be replaced by the use of index. In any event, while the use of regexes will not improve performance, it is also unlikely, IMHO, to significantly degrade it versus index in this case. But only benchmarking will determine the trade-offs.
Update: Minor wording changes; no semantic change.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Need Speed:Search Tab-delimited File for pairs of names
by wazat (Monk) on Dec 16, 2013 at 23:29 UTC | |
by Laurent_R (Canon) on Dec 17, 2013 at 10:02 UTC | |
|
Re^4: Need Speed:Search Tab-delimited File for pairs of names
by Laurent_R (Canon) on Dec 17, 2013 at 09:31 UTC |