From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3351 invoked by alias); 30 Apr 2007 20:05:45 -0000 Received: (qmail 3295 invoked from network); 30 Apr 2007 20:05:32 -0000 Received: from unknown (212.77.101.5) by sourceware.org with QMTP; 30 Apr 2007 20:05:32 -0000 Received: (wp-smtpd smtp.wp.pl 29030 invoked from network); 30 Apr 2007 22:05:32 +0200 Received: from host86-128-14-58.range86-128.btcentralplus.com (HELO BIGOS) (jagorak@[86.128.14.58]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with SMTP for ; 30 Apr 2007 22:05:32 +0200 Date: Mon, 30 Apr 2007 20:05:00 -0000 From: jagorak X-Mailer: Private Mailer 1.0 Reply-To: jagorak Message-ID: <328958546.20070430210531@wp.pl> To: Daniel Jacobowitz , Robert Dewar CC: gdb@sourceware.org Subject: Re[2]: Setting a variable is very slow. In-Reply-To: <20070421134117.GA10446@caradoc.them.org> References: <1546343093.20070421134325@wp.pl> <20070421134117.GA10446@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0U00000 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00177.txt.bz2 Thanks for the suggestions. A colleague of mine did some testing using the -statistics option and learned that setting variables are slow because of the ada mode (set lang ada). Switching to the "c" mode (set lang c) solves the problem. More info below for those who are interested: I had to resort to using mangled names (since in 'c' mode) , but they did not occur to be problematic. For a sample Ada type, say: Package.Data.DataMember the 'mangled' C names would be: package__data.datamember (all lower-case). (it will be more dificult if "Data" were to be type name). Note: I'm using customized version of GDB (custom target) and I realized that it may be that the 'plain' GDB works actually fine (=fast) in that aspect. (Although I don't really know.) I was trying to reproduce the problem on the 'plain' GDB (since oviously customized version is not of your concern!) to see whether the problem reoccurs. I created a very simple program with lots of symbols in it. The target was 'exec' - everything worked fine. (no significant delays). This is obviously not entirely representative 'test' since I feel the target may have impact here (regardless of any customizations to GDB). Regards, Jan DJ> On Sat, Apr 21, 2007 at 01:43:25PM +0100, jagorak wrote: >> I need to make hundreds of such assignments & calls. The problem is - >> setting a single variable is very slow (in most cases it takes much >> more time to set a single variable than to call a procedure, even if >> the procedure is not very simple). >> >> Any ideas why this is the case? DJ> I know of some problems in this area, but it's not clear which one is DJ> your problem here. Could you try building gdb with DJ> --enable-profiling? It should generate a gmon.out. That might not DJ> show the real problem; if you want to just build a debuggable version DJ> and use oprofile, that might work better. It depends whether GDB is DJ> eating CPU or being wasteful with ptrace operations.