From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14207 invoked by alias); 3 May 2004 01:56:23 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14198 invoked from network); 3 May 2004 01:56:23 -0000 Received: from unknown (HELO tisch.mail.mindspring.net) (207.69.200.157) by sources.redhat.com with SMTP; 3 May 2004 01:56:23 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by tisch.mail.mindspring.net with esmtp (Exim 3.33 #1) id 1BKSgw-0005G2-00; Sun, 02 May 2004 21:56:22 -0400 Received: by berman.michael-chastain.com (Postfix, from userid 502) id E2CCC4B104; Sun, 2 May 2004 21:56:20 -0400 (EDT) To: gdb@sources.redhat.com, savoiu@ics.uci.edu Subject: Re: Improving GDB startup time with large programs Message-Id: <20040503015620.E2CCC4B104@berman.michael-chastain.com> Date: Mon, 03 May 2004 01:56:00 -0000 From: mec.gnu@mindspring.com (Michael Elizabeth Chastain) X-SW-Source: 2004-05/txt/msg00015.txt.bz2 Hi Nick, > I'm currently using 6.1 to which I have just upgraded. However, it seems > about 15% slower at startup than 6.0 despite my expectations that it > would be faster. That's a bummer. I have one large C++ program, the 'monotone' executable, that got a lot faster (native i686-pc-linux-gnu, red hat 8.0, gcc 3.3.something). > I'm using g++ 3.2 with '-Wall -Wno-unused -g' You could try upgrading to g++ 3.3.3 or g++ 3.4.0. Basically, if you have a lot of disk space, and you configure the compiler with '--prefix=...', you can play with different compilers. I have no reason to think that will actually help any, though. > How do I profile gdb? When you build gdb, configure as normal. Then use this command to build: make CFLAGS='-pg' Then install as normal. (As you might already know, experimenting with different versions of gdb is a lot easier and safer if you use --prefix=... when configuring it. I have dozens of gcc's and several gdb's on my system at any time). Then run the new gdb as you normally would on your test program. Make sure to quit gdb cleanly at the end. Look for a file named 'gmon.out'. This is the data file from the profiler. Then run 'gprof /path/to/installed/bin/gdb' to see the output. It will have this kind of format: Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 16.67 0.01 0.01 175396 0.00 0.00 symbol_natural_name 16.67 0.02 0.01 27446 0.00 0.00 htab_find_slot_with_hash 16.67 0.03 0.01 15575 0.00 0.00 read_partial_die 16.67 0.04 0.01 146 0.07 0.10 dwarf2_read_abbrevs 16.67 0.05 0.01 7 1.43 1.98 find_methods 8.33 0.06 0.01 6466 0.00 0.00 xrealloc 8.33 0.06 0.01 31 0.16 0.16 xcalloc ... Now, if you can do this for gdb 6.0 versus gdb 6.1, and report the top 15-20 lines of the profile output, that would be interesting data. And then there's the CVS version of gdb. Michael C