This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

BASH slow on network share scripts (was RE: A Simple Real World Benchmark for cygwin)


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

The CYGWIN port of bash short-circuits the test by claiming the input is not

#ifndef __CYGWIN__
#  define fd_is_seekable(fd) (lseek ((fd), 0L, SEEK_CUR) >= 0)
#  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 ?


Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]