This is an archive of the discontinued LLVM Phabricator instance.

Avoid calculating the string hash twice in GsymCreator::insertString.
AbandonedPublic

Authored by simon.giesecke on May 18 2021, 2:00 AM.

Details

Reviewers
None
Summary

Do the single hash calculation before acquiring the lock, to reduce
lock contention. If Copy is true, and the string was not yet contained
in the StringStorage, use the new address from StringStorage, but
reuse the hash we already calculated.

Move FunctionInfo in addFunctionInfo rather than copying.

Use a non-recursive mutex in GsymCreator.

There doesn't seem to be a need to support recursive locking,
and a recursive mutex is unnecessarily inefficient.

Avoid underestimating the number of DIEs for a given debug info size.

Calculate indexes of last child of each DWARF entry once during tryExtractDIEsIfNeeded.

This ensures that the last child indexes are calculated in linear time and
can later be queried in constant time by getLastChild.

The baseline situation was that individual calls to getLastChild were linear in the
size of DieArray. Calling getLastChild once for every DWARFDebugInfoEntry was
amortized quadratic in the size of DieArray.

Reformat DWARFUnit.cpp

Diff Detail

Event Timeline

simon.giesecke created this revision.May 18 2021, 2:00 AM
simon.giesecke requested review of this revision.May 18 2021, 2:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2021, 2:00 AM
simon.giesecke abandoned this revision.May 18 2021, 2:00 AM