mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-18 16:04:34 +00:00
367da46e7a
During structural (function) type comparison, computing the pretty representation of the type at hand appears high on performance profiles, especially when type canonicalization wasn't really effective. This patch adds a type_base::get_cached_pretty_representation() and a function_type::get_cached_name() to cache the pretty representation of a type, as well as the function type name. This is way, the type representation is computed just once and stored into a cache. subsequent invocations of the function just look into the cache instead of computing the representation again. Note that we do this only for non-canonicalized types because these types can still be modified, and so caching the representation of a type that might be changed (and thus see its representation change) leads to issue. So the representation of non-canonicalized types is not cached. * include/abg-ir.h (type_base::get_cached_pretty_representation): Declare new function. (function_type::get_cached_name): Likewise. * src/abg-ir.cc (get_method_type_name): Use the new type_base::get_cached_pretty_representation function. (type_base::priv::{internal_cached_repr_, cached_repr_}): Add new data members. (function_type::priv::{internal_cached_name_, cached_name_}): Likewise. (type_base::get_cached_pretty_representation): Define new function. (function_type::get_cached_name): Likewise. (type_base::get_canonical_type_for): Call type_base::get_cached_pretty_representation here, so the internal representation is cached right before canonicalization. (function_type::{mark_as_being_compared, unmark_as_being_compared, comparison_started}): Uset he new type_base::get_cached_name to speed up function type name retrieval. 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 |