aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-record.c
diff options
context:
space:
mode:
authorJens Widell <jl@opera.com>2018-01-12 13:16:17 +0000
committerNick Clifton <nickc@redhat.com>2018-01-12 13:16:17 +0000
commit564e11c9a9d9570b233b38cd995f1b4eb7c757e8 (patch)
tree3282d9d08f64efc2e2f10ba13f89f3552b366050 /gdb/python/py-record.c
parentb5b62006522c6d8d42028754bb1be165f00fe210 (diff)
downloadgdb-564e11c9a9d9570b233b38cd995f1b4eb7c757e8.zip
gdb-564e11c9a9d9570b233b38cd995f1b4eb7c757e8.tar.gz
gdb-564e11c9a9d9570b233b38cd995f1b4eb7c757e8.tar.bz2
Optimize the performance of the group_setup function.
When processing a section that is a member of a group, the group that contains it is looked up using a linear search. The resulting O(n^2) complexity causes significant performance issues when dealing with object files with very many groups. By remembering the index of the last found group and restarting the next search from that index, the search instead becomes O(n) in common cases. * elf.c (setup_group): Optimize search for group by remembering last found group and restarting search at that index. * elf-bfd.h (struct elf_obj_tdata): Add group_search_offset field.
Diffstat (limited to 'gdb/python/py-record.c')
0 files changed, 0 insertions, 0 deletions