delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/26/17:51:16

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <FE045D4D9F7AED4CBFF1B3B813C85337676293@mail.sandvine.com>
From: Don Bowman <don AT sandvine DOT com>
To: "'cygwin-patches AT cygwin DOT com '" <cygwin-patches AT cygwin DOT com>,
"'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: [PATCH] improve performance of stat() operations (e.g. ls -lR)
Date: Sun, 26 May 2002 17:50:13 -0400
MIME-Version: 1.0
Note-from-DJ: This may be spam

------_=_NextPart_000_01C204FF.50974E20
Content-Type: text/plain;
	charset="iso-8859-1"


The attached patch adds a new CYGWIN environment variable, statquery. This
causes stat() to use set_query_open(TRUE) all the time, which
dramatically improves the performance on e.g. ls -lR operations or
configure.
For example, an ls -lR of the 'ntop' distribution goes from 34seconds
to 2seconds on my computer on a local filesystem. The actual change
is extremely trivial.



------_=_NextPart_000_01C204FF.50974E20
Content-Type: application/octet-stream;
	name="statquery.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="statquery.diff"

--- src/winsup/cygwin/environ.cc	2002-05-24 22:22:50.000000000 -0400=0A=
+++ src-new/winsup/cygwin/environ.cc	2002-05-26 16:23:31.000000000 =
-0400=0A=
@@ -36,6 +36,7 @@ extern BOOL allow_winsymlinks;=0A=
 extern BOOL strip_title_path;=0A=
 extern int pcheck_case;=0A=
 extern int subauth_id;=0A=
+extern BOOL stat_open_noread;=0A=
 BOOL reset_com =3D FALSE;=0A=
 static BOOL envcache =3D TRUE;=0A=
 =0A=
@@ -525,6 +526,7 @@ static struct parse_thing=0A=
   {"title", {&display_title}, justset, NULL, {{FALSE}, {TRUE}}},=0A=
   {"tty", {NULL}, set_process_state, NULL, {{0}, {PID_USETTY}}},=0A=
   {"winsymlinks", {&allow_winsymlinks}, justset, NULL, {{FALSE}, =
{TRUE}}},=0A=
+  {"statquery", {&stat_open_noread}, justset, NULL, =
{{FALSE},{TRUE}}},=0A=
   {NULL, {0}, justset, 0, {{0}, {0}}}=0A=
 };=0A=
 =0A=
--- src/winsup/cygwin/fhandler_disk_file.cc	2002-05-24 =
01:44:10.000000000 -0400=0A=
+++ src-new/winsup/cygwin/fhandler_disk_file.cc	2002-05-26 =
16:05:46.000000000 -0400=0A=
@@ -31,6 +31,8 @@ details. */=0A=
 #define _COMPILING_NEWLIB=0A=
 #include <dirent.h>=0A=
 =0A=
+BOOL stat_open_noread;=0A=
+=0A=
 static int=0A=
 num_entries (const char *win32_name)=0A=
 {=0A=
@@ -72,7 +74,7 @@ fhandler_disk_file::fstat (struct __stat=0A=
   if (!pc)=0A=
     return fstat_helper (buf);=0A=
 =0A=
-  if ((oret =3D open (pc, open_flags, 0)))=0A=
+  if (!stat_open_noread && (oret =3D open (pc, open_flags, 0)))=0A=
     /* ok */;=0A=
   else=0A=
     {=0A=
--- src/winsup/cygwin/ChangeLog	2002-05-24 22:22:50.000000000 -0400=0A=
+++ src-new/winsup/cygwin/ChangeLog	2002-05-26 17:29:11.000000000 =
-0400=0A=
@@ -1,3 +1,12 @@=0A=
+2002-05-26  Don Bowman  <don AT sandvine DOT com>=0A=
+=0A=
+	* Add new CYGWIN option, 'statquery', which causes the=0A=
+	stat() call to use the set_query_open(TRUE) all the time.=0A=
+	This significantly improves performance on e.g. ls -lR =0A=
+	operation. It would appear the CreateFile() on windows=0A=
+	reads a good chunk of the file when called for reading,=0A=
+	which isn't needed by stat().=0A=
+=0A=
 2002-05-24  Christopher Faylor  <cgf AT redhat DOT com>=0A=
 =0A=
 	Remove unneeded sync.h, where appropriate, throughout.=0A=


------_=_NextPart_000_01C204FF.50974E20
Content-Type: text/plain; charset=us-ascii

--
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/
------_=_NextPart_000_01C204FF.50974E20--

- Raw text -


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