Speeding my script
- From: Petyr David <phynkel@xxxxxxxxx>
- Date: Fri, 22 Feb 2008 10:38:12 -0800 (PST)
have a web page calling PERL script that searches for patterns in 20,
000 files + and returns link to files and lines found matching
pattern. I use a call to `find` and `egrep`
Q: Script works - but is straining under the load - files are in the
Gbs.
How to speed process? How simple to employ threads or slitting
off
new processes?
I know i should RTFM (LOL) and I will, but just looking for some
quick guidance/suggestions
pseudo code;
cd root of document directory
Load array with names of directories
forech subdir in @dirnames
cd $subdir
lots of if statements to figure what find command and what
option to use
@temp_array=`$long_find_grep_command`
push @temp_array onto big array
other processing
end foreach
what I'd like to do is to be able to simultaneously be searching more
than 1 subdirectory
TX for your help -
.
- Follow-Ups:
- Re: Speeding my script
- From: Jamie
- Re: Speeding my script
- From: J. Gleixner
- Re: Speeding my script
- From: smallpond
- Re: Speeding my script
- Prev by Date: Re: BEGIN not safe after errors--compilation aborted
- Next by Date: Intention to take over Finance::Bank::Cahoot
- Previous by thread: BEGIN not safe after errors--compilation aborted
- Next by thread: Re: Speeding my script
- Index(es):