This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

1.3.12-1: dramatic slowdown of compiled executable - 2nd attempt


I am running Cygwin environment on an IBM Intellistation (1GHz PIII, 512Mb
memory) with Windows 2000 Professional (SP 2).  I am attaching the output
of cygcheck -s -v -r.  I hope that attachments can be handled by the
discussion list server.

Here is the problem again.  A simple C code presented below (and also as an
attachment) runs 24 times slower under cygwin1.dll versions 1.3.11 and
1.3.12 than under 1.3.10 (and numerous previous versions).  Could somebody
pleas confirm this?

I compiled the code below using "gcc uu.c".  Then I created a simple text
file called "input" with 300,000 lines and 12 columns of floating point
numbers.  This is easy using a text editor - the lines can be the same.  I
ran it under current version of cygwin (1.3.12-1) using "time a.exe" and
got 241.7s total time and 239.3s of user time.

Then I replaced cygwin1.dll with version 1.3.10 and rerun the test.  I got
10.7s total time and 8.7s user time.  This is almost 24-fold slowdown!

Here is my code.  It is also attached, so one can simply detach and try it.
As one can see it only does I/O and nothing else.

=============================uu.c===================================
#include <stdio.h>

int main(int argc, char *argv[])
{

   int i, nobs;
   static float dat[300000][12];
   char filein[6], fileout[7];
   FILE *fp;

   strcpy(filein, "input");
   strcpy(fileout, "output");

   fp = fopen(filein, "r");
   i = 0;
   while(fscanf(fp, "%f %f %f %f %f %f %f %f %f %f %f %f",
       &dat[i][0], &dat[i][1], &dat[i][2], &dat[i][3], &dat[i][4],
       &dat[i][5], &dat[i][6], &dat[i][7], &dat[i][8], &dat[i][9],
       &dat[i][10], &dat[i][11])
       != EOF)
         i++;
   close(fp);
   nobs = i;
   printf("%d data lines read from %s\n", i, filein);

   fp = fopen(fileout, "w");
   for(i=0; i<nobs; i++)
       fprintf(fp, "%f %f %f %f %f %f %f %f %f %f %f %f\n",
       dat[i][0], dat[i][1], dat[i][2], dat[i][3], dat[i][4], dat[i][5],
       dat[i][6], dat[i][7], dat[i][8], dat[i][9], dat[i][10], dat[i][11]);
   close(fp);
   printf("%d data lines written to %s\n", i, fileout);

   exit(0);
}
====================================================================

Could somebody kindly repeat my experiment or at least time this code using 1.3.12 cygwin1.dll?

Thanks in advance,

Andy

(See attached file: ccc.txt)(See attached file: uu.c)

__________________________________
Andy Jaworski
Engineering Systems Technology Center
3M Center, 518-1-01
St. Paul, MN 55144-1000
-----
E-mail: apjaworski@mmm.com
Tel:  (651) 733-6092
Fax:  (651) 736-3122

Attachment: ccc.txt
Description: Binary data

Attachment: uu.c
Description: Binary data

--
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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]