bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make CVS 7X slower on Win32 NTFS than beta 4


From: J. David Bryan
Subject: Make CVS 7X slower on Win32 NTFS than beta 4
Date: Thu, 09 Feb 2006 12:23:22 -0500

Running under Windows (MSYS), I observe that make built from current CVS 
takes about seven times longer to check a large number of dependent files 
on an NTFS partition than did beta 4.  Sample timing from a 3 GHz machine 
using a makefile that assembles a large number of TIFF images into a PDF:

  $ time ./make-380 pdf
  make-380.exe: Nothing to be done for `pdf'.

  real    0m1.407s
  user    0m0.015s
  sys     0m0.000s

  $ time ./make-beta4 pdf
  make-beta4: Nothing to be done for `pdf'.

  real    0m1.672s
  user    0m0.015s
  sys     0m0.000s

  $ time ./make-cvs pdf
  make-cvs: Nothing to be done for `pdf'.

  real    0m11.625s
  user    0m0.015s
  sys     0m0.000s

Running "filemon" from Sysinternals, I see that many more directory 
accesses are performed with the CVS version than with beta 4 (~180K logged 
lines for the CVS version vs. ~40K lines for beta 4).

I have traced the problem to a patch to "dir.c" that was applied on 
February 1st.  This patch, to "dir_contents_file_exists_p", is to avoid 
using variable "st" unless it's initialized.  However, the applied patch 
also changes the logic at that point.

The CVS addition and the original patch are described here:

  http://lists.gnu.org/archive/html/make-w32/2006-02/msg00000.html
  http://lists.gnu.org/archive/html/make-w32/2005-04/msg00033.html

The intent appears to be to reread the directory only if the "modified" 
time is later than the stored time, or if the file system is FAT (which, 
apparently, doesn't support directory modified times).  The CVS version, 
though, causes the directory to be reread always.

The following revised patch would appear to fix the current problem, as 
well as address the "st" initialization problem:


diff -u -r original/dir.c patched/dir.c
--- original/dir.c      2006-02-06 11:22:00.000000000 -0500
+++ patched/dir.c       2006-02-09 11:28:36.000000000 -0500
@@ -641,13 +641,13 @@
        * filesystems force a rehash always as mtime does not change
        * on directories (ugh!).
        */
-      if (dir->path_key)
+      if (dir->path_key
+          && stat(dir->path_key, &st) == 0
+          && (dir->fs_flags & FS_FAT
+              || st.st_mtime > dir->mtime))
        {
-          if (!(dir->fs_flags & FS_FAT)
-              && (stat(dir->path_key, &st) == 0
-                  && st.st_mtime > dir->mtime))
-            /* reset date stamp to show most recent re-process */
-            dir->mtime = st.st_mtime;
+         /* reset date stamp to show most recent re-process */
+         dir->mtime = st.st_mtime;
 
          /* make sure directory can still be opened */
          dir->dirstream = opendir(dir->path_key);


With this patch, CVS and beta 4 times are now comparable:

  $ time ./make-cvs-fixed pdf
  make-cvs-fixed: Nothing to be done for `pdf'.

  real    0m1.672s
  user    0m0.015s
  sys     0m0.000s


                                      -- Dave





reply via email to

[Prev in Thread] Current Thread [Next in Thread]