An intolerably slow behavior during a cascade of constructor calls

Isselmou dellahy disselmou@hotmail.com
Fri Apr 29 07:42:00 GMT 2005


Hi,
I'm using cygwin 1.5.13-1 and gcc version 3.3.3.
My code is pretty big (70 K LOC of C++) right now, but I intend to minimize 
it if needed. But here's what its does in a nutshell:
It loads a text file of around 1 MB of data, then calls a cascade of 
inherited constuctors (three of them). And it looks like it hangs up 
(outside of my code) during one of these calls, then ends up coming back and 
executing the rest of the program. I first suspected the size of the 
parameters passed during those call; I was conforted in that the larger the 
file I load, the longer the hangup time lasts. But after a closer look, the 
parameters passed are small enough and the buffer containing the file is NOT 
one of them.

The magnitude of the problem is such that, the same program compiled on 
Linux and run on a similar machine, runs in 4 seconds while it needs more 
than 10 minutes on cygwin.

Here's a tentative minimal program that failed though to reproduce the slow 
behavior (probably because I do not load any big file).

Did anybody experience any similar problem lately?
Thank you for any hint
--
Isselmou

=============== cut here =====================
#include <stdio.h>


class TRANSFO
{
  public :
    TRANSFO();
    explicit TRANSFO( double tr[4][4]);
};

class NEU_BASIC : public TRANSFO
{
  public :
    explicit NEU_BASIC( char *filename,
                        int fid,
                        double tr[4][4],
                        FILE *fpin,
                        int tfl,
                        int lv,
                        double parent_unit_fact);
};

class NEU_PART : public NEU_BASIC
{
  public :
    explicit NEU_PART( char *filename,
                       int fid,
                       double tr[4][4],
                       FILE *fpin,
                       int lv,
                       double parent_unit_fact);
};

TRANSFO::TRANSFO( double tr[4][4])
{
  printf("Beginning TRANSFO::TRANSFO \n");fflush(stdout);
}
NEU_BASIC::NEU_BASIC( char *filename,
                      int fid,
                      double tr[4][4],
                      FILE *fpin,
                      int tfl,
                      int lv,
                      double parent_unit_fact
                     ) : TRANSFO(tr)
{
  printf("bbbbb Beginning of NEU_BASIC::NEU_BASIC\n");fflush(stdout);
}

NEU_PART::NEU_PART( char *filename,
                    int fid,
                    double tr[4][4],
                    FILE *fpin,
                    int lv,
                    double parent_unit_fact
                   ) : NEU_BASIC(filename, fid, tr, fpin, 1, lv, 
parent_unit_fact)
{
  printf("inside NEU_PART::NEU_PART \n");fflush(stdout);
}

int main()
{
  double tr[4][4];
  FILE *fpin=NULL;
  NEU_PART *prt = new NEU_PART( "aa", 0, tr, fpin, 0, 0.);

  return 0;
}
=============== cut here =====================

_________________________________________________________________
DonÂ’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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



More information about the Cygwin mailing list