X-Spam-Check-By: sourceware.org Date: Thu, 31 May 2007 18:59:54 -0400 From: MVUKOVIC AT nycap DOT rr DOT com Subject: Re: RE: slow bash command line and scripts In-reply-to: <2D9E96311DCA4C48BF185EA6928BC7BB01D76A12@asc-mail.int.ascribe.com> To: cygwin AT cygwin DOT com Cc: Phil Betts Message-id: MIME-version: 1.0 X-Mailer: iPlanet Messenger Express 5.2 HotFix 2.10 (built Dec 26 2005) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline References: <2D9E96311DCA4C48BF185EA6928BC7BB01D76A12 AT asc-mail DOT int DOT ascribe DOT com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com ----- Original Message ----- From: Phil Betts Date: Thursday, May 31, 2007 12:56 pm Subject: RE: slow bash command line and scripts To: cygwin AT cygwin DOT com > MVUKOVIC AT xxxxx DOT xx DOT xxx wrote on Thursday, May 31, 2007 2:53 PM:: > > > The response time to bash command from the command line is very > slow.> For example, if I type "ls", it takes about 0.5 sec to > get some > > output, and after the output, another 0.5 sec for the prompt. > > > > Likewise, my scripts are very slow (I was comparing files in two > > directories). Looking at the task manager, the CPU usage was in the > > single percent. > > > > I could not find much in past emails, except to provide strace > output.> > > I am attaching the strace output to running ls (strace -o ... > ls), and > > also the cygcheck output (cygcheck -srv). > > > > I've only glanced at the trace, so this is not a diagnosis, just an > observation. You should certainly look into cleaning up your PATH. > > The same directories are mentioned multiple times, this means that, as > well as having to parse a longer than necessary string, the same > directories will be searched multiple times. Note that /bin and > /usr/bin are usually the same in cygwin, so you only need one of them, > and it should usually be first so that the shell needs to do the bare > minimum to find the common commands. In general, application specific > directories should only come after system directories, unless the > commands in them are intended to replace system commands. In this > context, "system" means cygwin first, then Windows. > > It's _never_ smart to have "." in your PATH, because: > a) you're leaving yourself wide open to attack from malicious > software (e.g. if there is a file called ls.exe in the current > directory > that just happens to wipe your C drive, don't expect any > sympathy). b) the actual command file that runs should never depend > on where your > current directory happens to be (unless you explicitly type > "./commandname" of course), otherwise scripts that were > previously > reliable will mysteriously stop working when you're in a > particular > directory. > > > Phil > I followed Phil's advice and cleaned up PATH. What is interesting is that even with a bare cygwin start (no .bash_profile or .bashrc) I still have /bin, /usr/bin, and /usr/X11R6/bin (followed by the windows' system and user paths) in my path. I am guessing this is something internal to cygwin. I also noted that my /etc/group file was huge, because it was the result of the makegroup command, which gathered all the groups on our network. I removed most of the entries except the top ones that seemed to make sense. However, none of this has speeded up bash (sigh) (thanks Phil for your advice). Mirko -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/