Bad compile time complexity for large files ??? (fwd)

2004-11-10 Thread Gabriel Dos Reis

FYI.  Joris's messages seem to have been blocked...
Please, CC: Joris when replying.

Joris --

  It might help if you can provide information about the version of GCC
you're using. You might also want to try

   http://gcc.gnu.org/bugzilla/

That way, your report will be recorded in the PR database.

---BeginMessage---


Salut Gabriel,

J'ai essaye plusieurs fois de poster le message ci-dessous
sur la liste gcc, mais c'est systematiquement refuse.
Peut-etre que tu peux le poster et me forwarder d'eventuelles reponses.
Je me suis desinscrit de la liste, car il y avait trop de messages.

A+, Joris


-- Forwarded message --
Date: Tue, 9 Nov 2004 12:00:47 +0100 (CET)
From: Joris van der Hoeven [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Bad compile time complexity for large files ??? (fwd)

Hi,

I have suscribed to the gcc mailing list in order to send
the message below, but it keeps being rejected. Why?

Joris

-- Forwarded message --
Date: Tue, 9 Nov 2004 11:36:29 +0100 (CET)
From: Joris van der Hoeven [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Bad compile time complexity for large files ???


Hi *,

I am using g++ for compiling automatically generated glue files
for another language (mathemagix). These glue files tend to become
quite big when I want to glue big C++ libraries. More precisely,
they contain a lot of small methods and routines, like

--
[...]
ext_inst
ext_mml_vector_rep::gen_timesassign (ext_inst arg_1, ext_inst arg_2) {
  ext_type save_1 = ext_cur_1;
  ext_cur_1 = x_1;
  ext_inst ret = convertext_inst, mml_vectorext_inst_1  
(convertmml_vectorext_inst_1, ext_inst  (arg_1) *= 
convertmml_vectorext_inst_1, ext_inst (arg_2));
  ext_cur_1 = save_1;
  return ret;
}
[...]
static mmx::generic
FUN_29 (mmx::generic g) {
  return mmx::as_mmxdouble, TID (mmx::as_cppdouble, TID (g[1]) *= 
mmx::as_cppdouble, TID (g[2]));
}
[...]
--

The number of classes is relatively small.

When the number of routines increases, I noticed a far more than
linear time complexity for the compilation time. This is very
disappointing for me, since it makes it nearly impossible to compile
glue files with more than a few hundred routines.

I suspect that this behaviour is due to a lack of optimization
in the way identifiers are stored by the compiler: does gcc use
a linked list instead of a hash table? Is there a compilation
option that I may have overlooked?

I would be very interested in having this important drawback being
removed; such an optimization will probably be interesting anyway,
since the performance already drops sharply for files with a few
thousand lines. If I can somehow help with improving this point,
then please let me know; I know nothing about the g++ source code,
but may learn the necessary if somebody guides me.

Best wishes, Joris

---
Joris van der Hoeven [EMAIL PROTECTED]
http://www.texmacs.org: GNU TeXmacs scientific text editor
http://www.math.u-psud.fr/~vdhoeven: personal homepage
---
---End Message---


-- 
Gabriel Dos Reis
 [EMAIL PROTECTED]
Texas AM University -- Department of Computer Science
301, Bright Building -- College Station, TX 77843-3112


Re: Bad compile time complexity for large files ??? (fwd)

2004-11-10 Thread Matt Austern
On Nov 10, 2004, at 11:14 AM, Gabriel Dos Reis wrote:
FYI.  Joris's messages seem to have been blocked...
Please, CC: Joris when replying.
Joris --
  It might help if you can provide information about the version of GCC
you're using. You might also want to try
   http://gcc.gnu.org/bugzilla/
That way, your report will be recorded in the PR database.
I would be interested in seeing a test case.  Compilation speed is 
important, and if there really is something that cases superlinear 
behavior I would like to fix it.

--Matt