[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug default/19355] [PERF] Libabigail slow on the r300_dri.so binary



https://sourceware.org/bugzilla/show_bug.cgi?id=19355

--- Comment #3 from dodji at redhat dot com ---
I am keeping this bug open still, as I hope we can keep further improve these
times.

Profiling suggests that one area that is taking time now is string comparison,
especially during the type hashing necessary for emitting the native xml
representation out to disk.  My understanding so far is that we spend a
significant amount of time comparing (class) type names and qualified names.

Note that (interestingly), that string comparison doesn't show up as a hot spot
during type comparisons that are the core of libabigail's comparison engine.
This is because types are canonicalized and so comparing two types (in general)
amounts to comparing two pointers.  One exception to that is when we compare
two classes A and B, and when either A or B is a declaration-only class.  In
that case, that comparison involves comparing their names.

Thus, I think that interning those strings
(https://en.wikipedia.org/wiki/String_interning) would help speed up things
here.

So maybe we could try to come up with an abigail::intern_string type that would
have methods to inter-operate seamlessly with the current std::string which is
used throughout the code base.  We'd then make abigail::decl_base::get_name()
and abigail::decl_base::get_qualified_name() return abigail::intern_string,
adjust what needs adjusting and see what we get in terms of speed increase
there.

-- 
You are receiving this mail because:
You are on the CC list for the bug.