delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/29/12:59:48

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: Yes, hits=5.8 required=5.0 tests=BAYES_20,BOTNET,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB
X-Spam-Check-By: sourceware.org
Message-id: <4BB0EA78.8030004@cygwin.com>
Date: Mon, 29 Mar 2010 13:59:20 -0400
From: "Larry Hall (Cygwin)" <reply-to-list-only-lh AT cygwin DOT com>
Reply-to: cygwin AT cygwin DOT com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090320 Remi/2.0.0.21-1.fc8.remi Lightning/0.9 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0
MIME-version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: slow file open
References: <680267dc1003290849s45f96dd6t1eacd043f53f7334 AT mail DOT gmail DOT com> <680267dc1003290851i67c10a82hf4e5c48a47969320 AT mail DOT gmail DOT com>
In-reply-to: <680267dc1003290851i67c10a82hf4e5c48a47969320@mail.gmail.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 3/29/2010 11:51 AM, Erdem Guven wrote:
> Hello,
>
> My application uses fopen to open a lot of files. While in linux
> opening and reading thousand of files doesn't even take a second; in
> cygwin it takes more than 5 seconds.
>
> I think it is because path conversion functions in cygwin dlls. 'open'
> function is a bit faster. If I use -mno-cygwin it becomes very fast
> but I can't use it.
>
> Is there an easy way to make cygwin dlls just open files; without any
> linux-windows conversion?

Unfortunately, Cygwin 1.7 removed the "run really fast" switch.  Stupid
Cygwin! ;-)

But seriously, the best way to avoid the path conversions is to not use
Cygwin.  Cygwin provides the POSIX paths for compatibility.  If you need
that compatibility, then Cygwin is for you.  If you don't, then maybe it
isn't.  Since you mention above that you cannot use the -mno-cygwin flag
that comes with the (old) compiler, I'm assuming that you have a need for
the POSIX stuff that Cygwin provides.

One possibility of bypassing the path handling in your programis to use
'\' as your path separator in all the file paths.  This won't work in all
cases but it's possible it could help in yours.

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019