From: Green, Simon (Simon.Green@EU.ALTRIA.COM)
Date: Tue May 04 2004 - 07:40:32 EDT
Thanks for that Bill: very interesting. I knew that spawning a new shell
was resource intensive but that really brings it home.
On a similar note, it's worth avoiding un-necessary greps when you can: I
often see commands/scripts which have one grep piping directly into another.
This can often be avoided by using a more complicated grep, or even
something like awk: maybe even perl. The added overhead of the more
complicated command is less than that of spawning another shell in most
cases.
-- Simon Green Altria ITSC Europe Ltd AIX-L Archive at https://new-lists.princeton.edu/listserv/aix-l.html New to AIX? http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX N.B. Unsolicited email from vendors will not be appreciated. Please post all follow-ups to the list. > -----Original Message----- > From: Bill Thompson [mailto:bill.thompson@GOODYEAR.COM] > Sent: 04 May 2004 12:19 > To: aix-l@Princeton.EDU > Subject: Re: Filename conversion to uppercase > > > This is an FYI for all of you shell scripters out there. > > All the methods presented to convert a text string to > uppercase characters work equally well however the time they > take to do the > conversion varies greatly. If you're converting a handful of > files you'll never see the difference. However, if you're converting a > large number of files the time difference can be astonishing. <SNIP> > No, that's not a mistake. Script 1 took 8 seconds to run > while the others took 2 hours. The scripts that spawned > another process (or > actually spawned 84,600 processes - one for each filename) > took close to 1,000 times longer to perform the same function! > > So, when you're writing your scripts out there, remember - > spawning another process is the most costly thing you can do on a Unix > system.
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:53 EDT