in reply to Is this the most efficient way to monitor log files..

Another thing that is nipping at your heels in the way of CPU usage is your means of displaying a status. (You could use Curses, but why bother?). The problem here is buffering is on. Since buffering is on you are having to overflow the buffer before anything gets dumped to your terminal, thanks to \r your terminal then proceeds to run through a buffers worth of lines (last I checked on on my linux box it was 2kb), and then display the last one. Not so efficient. $|++ And so you don't need to print a status update every round the loop, you eyes cannot see much more than 26 fps :-P

--
perl -pe "s/\b;([mnst])/'\1/mg"

  • Comment on Re: Is this the most efficient way to monitor log files..