]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Get rid of sections sorting with qsort and use an incrementally updated addrmap instead
authorPedro Alves <palves@redhat.com>
Fri, 1 Apr 2016 00:14:30 +0000 (01:14 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 19 Sep 2016 14:44:41 +0000 (15:44 +0100)
commit5cd42e9fb13d25febe3da26595d044a57150cee5
treede446febb2e0d8f298d27d587d16610410d5918f
parent55a083f3a4732aef274ab29339e118cd7a2a4a23
Get rid of sections sorting with qsort and use an incrementally updated addrmap instead

This gives a massive speed up.  The problem with the qsort is that we
qsort for any one of the thousands of jit loads/unloads, and when you
have thousands of objfiles, that gets very slow.  In this scenario,
we're constantly adding/removing a handfull of obj_sections to a set
of thousands of already-sorted obj_sections.  It's much cheaper to do
an incremental update.

I'm using a mutable addrmap for this, but I needed to add a new
primitive that allowed updating a region's object, to handle the case
of overlapping sections.  The only primitive available, only allows
setting a value to a currently-NULL region.
gdb/addrmap.c
gdb/addrmap.h
gdb/objfiles.c
gdb/objfiles.h
gdb/solib-svr4.c
gdb/symfile.c