Re: Filename conversion to uppercase

From: Michael Cheselka (cheselka@LINUX.CACTUS.ORG)
Date: Tue May 04 2004 - 18:42:37 EDT


I assume you didn't try xargs.

On Tue, May 04, 2004 at 07:19:06AM -0400, Bill Thompson wrote:
> 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*
> I ran these five scripts against a directory containing 84,600 files and recorded the execution time. They were dramatically
> different:
>
> script 1: 8.0 seconds
>
> script 2: 2:03:14.5 = 7394.5 seconds
>
> script 3: 1:52:44.2 = 6764.2 seconds
>
> script 4: 1:52:41.9 = 6761.9 seconds
>
> script 5: 2:01:38.1 = 7298.1 seconds
>
> 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.
>
> Bill Thompson
> Sr UNIX Systems Administrator
> The Goodyear Tire & Rubber Co.
>
> Contains Confidential and/or Proprietary Information
> May Not Be Copied or Disseminated Without Express Consent of The Goodyear Tire & Rubber Company.

--
Michael R. M. Cheselka                     ryoohki@ryoohki.org
Itsu Made Mo "Love & Peace"                 ryoohki@spymac.com
http://www.cactus.org/~cheselka            cheselka@cactus.org


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:53 EDT