Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 From: "Dan Vasaru" To: Subject: BASH slow on network share scripts (was RE: A Simple Real World Benchmark for cygwin) Date: Wed, 4 Sep 2002 23:44:52 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal In-Reply-To: <20020904112249.D1213@cygbert.vinschen.de> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Corinna, Tnx for taking the trouble of fixing the symlinks. Let's hope it was worth it :) I have uncovered another problem now, with the CYGWIN port of bash. At least when reading/executing a script, bash checks whether the file descriptor is seekable; if not, it will not perform input buffering of any kind. The CYGWIN port of bash short-circuits the test by claiming the input is not seekable: bash/input.c #ifndef __CYGWIN__ # define fd_is_seekable(fd) (lseek ((fd), 0L, SEEK_CUR) >= 0) #else # define fd_is_seekable(fd) 0 #endif /* __CYGWIN__ */ The result is abysmal performance when the script resides on a network drive, since bash will read one byte at a time (ultimately resulting in a network packet per script byte, assuming the OS does not cache the script). /bin/bash is tens of times slower compared to /bin/sh for an e.g. 200kb SAMBA-resident script file. I know, it's a BIG script. Since CYGWIN seems to go to some length to allow O_TEXT seeking, I believe the ifdef above to be a remnant of some times where cygwin1.dll didn't support text seeks, and I propose to remove it. I don't know who to contact on this issue, so someone please notify the current bash-cygwin maintainer ? Dan -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/