good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Re: Performance Questionby ferrency (Deacon) |
on May 08, 2002 at 14:08 UTC ( [id://165039]=note: print w/replies, xml ) | Need Help?? |
Ariels wrote: How can you have 70% CPU idle and load average 1.25? Load average is the average number of processes waiting for a resource before they can continue running. CPU isn't the only resource: your load can spike if your processes are hammering IO as well. My guess is that, assuming your per-line transformations are relatively small, this problem is disk-bound. If that's the case, buffering would help. But there's only one sure way to find out: make some changes and see if it makes a difference. One possible scenario is: you have autoflush turned on on your input and/or output filehandles. Every time you read a line, the disk heads travel to one end of the disk. Every time you write a line, the disk heads travel all the way back to the other end of the disk. This isn't unthinkable if your files are large, or if your disk is full or fragmented. With more buffering, you'd decrease the number of disk accesses, and decrease the overhead associated with cross-disk head movement. Just a guess, but possibly worth checking out. Alan
In Section
Seekers of Perl Wisdom
|
|