delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/04/28/23:55:27

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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: <BAY101-F25E7444435B17D1D5065D9BC240@phx.gbl>
X-Originating-Email: [disselmou AT hotmail DOT com]
X-Sender: disselmou AT hotmail DOT com
From: "Isselmou dellahy" <disselmou AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: An intolerably slow behavior during a cascade of constructor calls
Date: Thu, 28 Apr 2005 22:53:51 -0500
Mime-Version: 1.0
X-OriginalArrivalTime: 29 Apr 2005 03:53:51.0805 (UTC) FILETIME=[0E7C86D0:01C54C6F]

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/

- Raw text -


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