564e11c Optimize the performance of the group_setup function.

3 files Authored by Jens Widell 6 years ago, Committed by nickc 6 years ago,
    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.
    
        
file modified
+6 -0
file modified
+4 -0
file modified
+8 -3