Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

Re: [awipsldm] Re: LDM Observations and Comments (fwd)

NOTE: The decoders mailing list is no longer active. The list archives are made available for historical reasons.



==============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
rkambic@xxxxxxxxxxxxxxxx                   WWW: http://www.unidata.ucar.edu/
==============================================================================

---------- Forwarded message ----------
Date: Mon, 07 Feb 2000 15:37:38 -0700
From: Russ Rew <russ@xxxxxxxxxxxxxxxx>
To: Ken Waters <Ken.Waters@xxxxxxxx>
Subject: Re: [awipsldm] Re: LDM Observations and Comments
Ken,

A few other things that might speed up your perl scripts invoking
"system":

- Use "exec" instead of system, to save an extra invocation of "sh"
  for every system call

- Use "/bin/mv" instead of "mv", etc., to make sure exec doesn't
  invoke "sh" just to find where the executables are in your PATH.

- Instead of
   system("mv $work/$path/$filenm.8.txt $work/$path/$filenm.9.txt");
   system("mv $work/$path/$filenm.7.txt $work/$path/$filenm.8.txt");
   system("mv $work/$path/$filenm.6.txt $work/$path/$filenm.7.txt");
   system("mv $work/$path/$filenm.5.txt $work/$path/$filenm.6.txt");
   system("mv $work/$path/$filenm.4.txt $work/$path/$filenm.5.txt");
   system("mv $work/$path/$filenm.3.txt $work/$path/$filenm.4.txt");
   system("mv $work/$path/$filenm.2.txt $work/$path/$filenm.3.txt");
   system("mv $work/$path/$filenm.1.txt $work/$path/$filenm.2.txt");
   system("cp $temp/$filenm.tmp $work/$path/$filenm.1.txt");

  use a separate shell script that has all the above in it and just
  invoke that with a single "system" or "exec" call, using only half
  as many processes.  A separate shell script could also just cd to
  $work/$path/ first, and then all the mv commands would take place
  in the same directory, saving many file system accesses looking in
  the nested directories.

--Russ


  • 2000 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the decoders archives: