This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Use binary search instead of linear search in corefile.c of gprof
- From: Tristan Gingold <gingold at adacore dot com>
- To: Dongsheng Xing <homer dot xing at yahoo dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 15 Jun 2009 15:20:02 +0200
- Subject: Re: [PATCH] Use binary search instead of linear search in corefile.c of gprof
- References: <529129.60712.qm@web43401.mail.sp1.yahoo.com>
On Jun 15, 2009, at 3:11 PM, Dongsheng Xing wrote:
Hi!
This patch replace linear search by binary search in
core_create_syms_from().
This is implemented by qsort(symbol_map) in
read_function_mappings() by function name, thus we can do binary
search in core_create_function_syms() based on function name.
Just being curious: if you sort with qsort(), why don't you search
with bsearch() ?