From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22911 invoked by alias); 4 May 2004 19:44: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 22898 invoked from network); 4 May 2004 19:44:22 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 4 May 2004 19:44:22 -0000 Received: from drow by nevyn.them.org with local (Exim 4.32 #1 (Debian)) id 1BL5q1-0004Sd-JG; Tue, 04 May 2004 15:44:21 -0400 Date: Tue, 04 May 2004 19:44:00 -0000 From: Daniel Jacobowitz To: Nick Savoiu Cc: gdb@sources.redhat.com Subject: Re: Improving GDB startup time with large programs Message-ID: <20040504194421.GA17015@nevyn.them.org> Mail-Followup-To: Nick Savoiu , gdb@sources.redhat.com References: <20040502224944.847584B104@berman.michael-chastain.com> <200405021948.50571.savoiu@ics.uci.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200405021948.50571.savoiu@ics.uci.edu> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-05/txt/msg00027.txt.bz2 On Sun, May 02, 2004 at 07:48:50PM -0700, Nick Savoiu wrote: > >> How do I profile gdb? > > > >When you build gdb, configure as normal. > >Then use this command to build: > > Here's what I got (the most significant stuff) with g++ 3.2. Seems > that the number of symbols is the culprit. First of all, as Andrew said, use something like oprofile instead of gprof / -pg profiling. The top three functions on your profile below are called extremely often and do extremely little work -> call graph profiling inflates their time significantly. Secondly, the big change in the 6.0 / 6.1 profiles you've posted is the increased use of strcmp_iw_ordered. David Carlton noticed that this change was in fact necessary for correctness. I've been thinking about alternate approaches to avoid it - the comparison is quite expensive - but it's going to take a lot of work. Third, most of the time in your example is spent reading partial symbols. If you use a GCC new enough to support -g -feliminate-dwarf2-dups, and a GDB snapshot from the "drow_intercu-20040221-branch" branch of CVS, there will be many fewer partial symbols; that should improve your startup time somewhat. -- Daniel Jacobowitz