This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
BASH slow on network share scripts (was RE: A Simple Real World Benchmark for cygwin)
- From: "Dan Vasaru" <dvasaru at broadpark dot no>
- To: <cygwin at cygwin dot com>
- Date: Wed, 4 Sep 2002 23:44:52 +0200
- Subject: BASH slow on network share scripts (was RE: A Simple Real World Benchmark for cygwin)
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/