in reply to Perl Script performance issue
Hello Tara, and welcome to the Monastery!
One obvious slow-down is the shell-out call to system grep:
$final_data = ` grep "$key_pattern" "${indir}/${lkp_file_name}" |cut - +d"|" -f"$data_location"`;
which is expensive in itself and rendered especially so by being nested inside three loops. Try replacing it with a call to Perl’s inbuilt grep and see if that produces a significant speedup.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Script performance issue
by Tara (Initiate) on Dec 17, 2015 at 12:39 UTC | |
by Athanasius (Archbishop) on Dec 17, 2015 at 13:54 UTC |