Slow cygwin file opened

My application uses fopen to open a large number of files. While opening and reading linux, thousands of files do not even take a second; cygwin takes more than 5 seconds.

I think this is because path conversion functions in cygwin dll. The open function is a little faster. If I use -mno-cygwin, it becomes very fast, but I can not use it.

Is there an easy way to make cygwin dll just open files; without linux-windows conversion?

+7
cygwin
source share
1 answer

It depends on how the system was mounted in a Cygwin environment.

$ mount C:/cygwin/bin on /usr/bin type ntfs (binary,auto) C:/cygwin/lib on /usr/lib type ntfs (binary,auto) C:/cygwin on / type ntfs (binary,auto) C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto) D: on /cygdrive/d type iso9660 (binary,posix=0,user,noumount,auto) 

The binary mount option CRLF ↔ LF conversions from being performed on files read from the volume. This is the default value.

Some things you can do to speed up Cygwin's prompts are as follows:

1: add the following lines to ~/.bashrc :

 # eliminate long Window$ pathnames from the PATH export PATH='/bin:/usr/bin:/usr/local/bin' # check the hash before searching the PATH directories shopt -s checkhash # do not search the path when .-sourcing a file shopt -u sourcepath 

2: Disconnect network drives.

3: use the --cache-file="$HOME/.config.cache" when running autotools configure scripts.

This will create a file that stores pre-recorded configurations, most of which can be used between software assemblies. (This is also a good idea when using Linux.)

Since the shell seems to be the bottleneck of the Cygwin system, a huge script that relies on starting a large number of processes will be forever, and this will reduce the number of processes that need to be launched.

4: Configure Cygwin sshd and stop using the Windows command line in favor of PuTTY.

PuTTY responds better to changing text on the screen because it was created for the more mature * NIX CLI interface. The Windows command line (& trade;) is just awful.

+6
source share

All Articles