From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10386 invoked by alias); 27 Jan 2003 16:49:43 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 10365 invoked from network); 27 Jan 2003 16:49:42 -0000 Received: from unknown (HELO ktaemail01.villa-bosch.de) (212.126.215.56) by 172.16.49.205 with SMTP; 27 Jan 2003 16:49:42 -0000 Received: from poseidon ([212.126.215.53]) by ktaemail01.villa-bosch.de with Microsoft SMTPSVC(5.0.2195.2966); Mon, 27 Jan 2003 17:48:12 +0100 Date: Mon, 27 Jan 2003 16:49:00 -0000 From: Ralph Gauges To: gcc-help@gcc.gnu.org Subject: compile speed of gcc 2.95 vs 3.2 Message-Id: <20030127174939.0b4644df.ralph.gauges@eml.villa-bosch.de> Organization: European Media Laboratory Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 27 Jan 2003 16:48:12.0468 (UTC) FILETIME=[E13AD740:01C2C623] X-SW-Source: 2003-01/txt/msg00248.txt.bz2 Hello, I already posted a similar question to the libstdc++ list, but maybe this list is the right on since it seems to boil down to the compiler. Here is the problem: I have written a class that uses lots of insert statements of maps and inserts lots of strings (about 4000 all in all). Now I tried to compile it with g++ 3.2. Without optimization it took several minutes, with optimization (O3) it took a long long time (I actually stopped after 4 hours). I also tried to compile it on g++ 2.95 but with optimization it would run out of memory on a 1GB Machine (which is strange but seems to be a different problem). I now made some changes to get rid of redundant strings and only use pointers to strings in the map. This already seems to have had some effect because now it compiles in a few seconds with g++ 2.95 (-O0) up to several minutes (-O3). But if I try to compile it with g++ 3.2 it takes several minutes (-O0) up to several hours (-O3). I read some posts in the mailing list that other people have noticed a slow down in compile speed from g++ 2.95 to g++ 3.x and they reported slow downs that are about factor 2 to 10. The slow down I got with g++ 3.2 here seems to be around 40! I also tried the latest cvs sources, but it is just as slow. Is this a known problem? Is there anything one can do in order to avoid this besides using gcc 2.95? I don't care about twice or even three times the compile time, but I don't want to wait for hours everytime I compile the class. Thanks a lot Ralph