Dennis wrote:
> You can rip out a lot of code (well, some code) if you just use the Perl 
> date method by default and forget the date +%s stuff entirely.

Your mileage may vary.

$ time perl -le print+time

real    0m0.002s

$ time date +%s

real    0m0.001s

(Those results were surprisingly consistent on my Linux box.)

My version of "keep it simple" in this situation is that if you have to
invoke another language interpreter to provide a required feature, the
base script itself should probably be written in a different language.

If the base script will remain a shell script, you're better off invoking
smaller, less-expensive programs whenever possible. This cost savings
diminishes very quickly if your script has to make a lot of external
program calls, where with a more fully featured language you might have
handled all those external functions in-line.

If it matters enough, of course, you try both, and profile the results
to see which is more efficient under load.

I'm probably preaching to the choir on this, and for that I apologize.
It's already been a long week.

--Kyle
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://lurker.clamav.net/list/clamav-users.html

Reply via email to