mirror of
git://sourceware.org/git/libabigail.git
synced 2025-03-07 15:17:39 +00:00
While emitting an abixml output for a corpus_group representing the KMI of a Linux kernel tree, profiling shows that during comparison of class types, calling class_decl::get_definition_of_declaration is a hotspot. Especially, the fact the function returns a shared pointer that has to be "handled" shows up in the profile. This patch introduces a class_decl::get_naked_definition_of_declaration that returns a pointer. Not a shared pointer. The patch then uses that get_naked_definition_of_declaration function in the comparison code for class_decl. The patch also uses get_naked_canonical_type instead of get_canonical_type when comparing a bunch of other types. This makes things a little bit faster when compiled without optimization between 2% and 5%. * include/abg-ir.h (class_or_union::get_naked_definition_of_declaration): Declare a new member function. (class_decl::get_naked_definition_of_declaration): Likewise. * src/abg-ir.cc ({type_decl, qualified_type_def, array_type_def, enum_type_decl}::operator==): Use the get_naked_canonical_type and get_naked. (class_or_union::priv::naked_definition_of_declaration_): Define new data member. (class_or_union::priv::priv): Adjust to initialize the new data member. (class_or_union::get_naked_definition_of_declaration): Define new member function. ({class_or_union, class_decl}::operator==): Use the new get_naked_definition_of_declaration instead of get_definition_of_declaration. (equals): In the overload for class_or_union, do the same. (class_decl::get_naked_definition_of_declaration): Define new member function. (hash_type_or_decl): Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
abg-comp-filter.h | ||
abg-comparison.h | ||
abg-config.h | ||
abg-corpus.h | ||
abg-diff-utils.h | ||
abg-dwarf-reader.h | ||
abg-fwd.h | ||
abg-hash.h | ||
abg-ini.h | ||
abg-interned-str.h | ||
abg-ir.h | ||
abg-libxml-utils.h | ||
abg-libzip-utils.h | ||
abg-reader.h | ||
abg-sptr-utils.h | ||
abg-suppression.h | ||
abg-tools-utils.h | ||
abg-traverse.h | ||
abg-version.h.in | ||
abg-viz-common.h | ||
abg-viz-dot.h | ||
abg-viz-svg.h | ||
abg-workers.h | ||
abg-writer.h | ||
Makefile.am |