From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3283 invoked by alias); 17 Jul 2009 15:07:00 -0000 Received: (qmail 3273 invoked by uid 22791); 17 Jul 2009 15:06:59 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Jul 2009 15:06:52 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6HF6n70022023; Fri, 17 Jul 2009 11:06:49 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6HF6mbS026736; Fri, 17 Jul 2009 11:06:48 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6HF6lpL007060; Fri, 17 Jul 2009 11:06:47 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id A8B5737828B; Fri, 17 Jul 2009 09:06:46 -0600 (MDT) To: Paul Pluzhnikov Cc: gdb-patches ml Subject: Re: [patch] Speed up find_pc_section References: <8ac60eac0907161724v40e5bd8bg7877d8901b8d7b6e@mail.gmail.com> From: Tom Tromey Reply-To: tromey@redhat.com Date: Fri, 17 Jul 2009 16:27:00 -0000 In-Reply-To: <8ac60eac0907161724v40e5bd8bg7877d8901b8d7b6e@mail.gmail.com> (Paul Pluzhnikov's message of "Thu\, 16 Jul 2009 17\:24\:27 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00429.txt.bz2 >>>>> "Paul" == Paul Pluzhnikov writes: Paul> Attached patch turns linear search into binary search, speeding up Paul> find_pc_section drastically :-) I love patches like this. Paul> +static int objfiles_updated_p; This (plus the map itself) seems like another thing that will have to be per-inferior or per-address-space. But, perhaps we aren't quite ready for that yet. Paul> + objfiles_updated_p += 1; /* Rebuild section map next time we need it. */ It seems like we would need one of these in objfile_relocate, and maybe in reread_symbols. What do you think? Paul> +/* Bsearch comparison function. */ Paul> + Paul> +int Paul> +find_pc_section_cmp (const void *key, const void *elt) Should be static. Tom