slow ar on cygwin windows patch

Christopher Faylor cgf@redhat.com
Thu Jan 25 21:15:00 GMT 2001


B19 is about three years old.  I don't think that there is any reason
to apply this patch unless the current version of Cygwin is this slow.

Even then, you are removing functionality that actually works in Cygwin
as it does on UNIX.  I don't think I feel comfortable with making things
faster while losing functionality.

Possibly an ar command line option would be appropriate, though.

cgf

On Thu, Jan 25, 2001 at 03:54:02PM -0800, Mike Stump wrote:
>I've found that I need the below patch on Windows to prevent it from
>being 233 times slower when cygwin (B19) is hosting when an achieve is
>being created with 14 .o files.  Without this patch, it was taking
>over a minute, with the patch, 0.3 seconds, a worthwhile win.
>
>2001-01-25  Mike Stump  <mrs@kankakee.wrs.com>
>
>	* rename.c (smart_rename): Don't use chown/chmod on Cygwin on
>          Windows, it is very slow.
>
>*** rename.c.old	Mon Oct  4 14:06:46 1999
>--- rename.c	Thu Jan 25 15:45:31 2001
>*************** smart_rename (from, to, preserve_dates)
>*** 178,183 ****
>--- 178,187 ----
>        ret = rename (from, to);
>        if (ret == 0)
>  	{
>+ 	  /* This speed up creating an archive with ar with 14 .o
>+ 	     files 233x on Windows, this functionality isn't worth the
>+ 	     slowness.  */
>+ #if ! defined (_WIN32)
>  	  if (exists)
>  	    {
>  	      /* Try to preserve the permission bits and ownership of
>*************** smart_rename (from, to, preserve_dates)
>*** 196,201 ****
>--- 200,206 ----
>  	      if (chown (to, s.st_uid, s.st_gid) >= 0)
>  		chmod (to, s.st_mode & 07777);
>  	    }
>+ #endif
>  	}
>        else
>  	{
>------------------------------

-- 
cgf@cygnus.com                        Red Hat, Inc.
http://sources.redhat.com/            http://www.redhat.com/


More information about the Binutils mailing list