Skip to content

Commit b73389a

Browse files
jeffreytan81George Hu
authored andcommitted
Temporarily disable deferencing for libstdcpp shared_ptr data formatter
Summary: We have noticed a significant performance issue using .debug_names which is triggered from shared_ptr/weak_ptr summary and synthetic children providers. This is diff temporarily disables deferencing in the data formatters to avoid the expensive code path. See T164523815 for more details. Test Plan: Adfinder locals window immediately shows up. Reviewers: gclayton, wanyi, hyubo, #lldb_team Reviewed By: wanyi Subscribers: #lldb_team Differential Revision: https://phabricator.intern.facebook.com/D49614423 Tasks: T164523815
1 parent a086f0d commit b73389a

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,20 @@ bool lldb_private::formatters::LibStdcppSmartPointerSummaryProvider(
336336
return true;
337337
}
338338

339-
Status error;
340-
ValueObjectSP pointee_sp = ptr_sp->Dereference(error);
341-
if (pointee_sp && error.Success()) {
342-
if (pointee_sp->DumpPrintableRepresentation(
343-
stream, ValueObject::eValueObjectRepresentationStyleSummary,
344-
lldb::eFormatInvalid,
345-
ValueObject::PrintableRepresentationSpecialCases::eDisable,
346-
false)) {
347-
return true;
348-
}
349-
}
339+
// TODO: temporary disable the summary provider deference for smart pointers
340+
// because it is causing performance issues while completing certain template
341+
// heavy types. We will revisit this issue after T164523815 is fixed.
342+
// Status error;
343+
// ValueObjectSP pointee_sp = ptr_sp->Dereference(error);
344+
// if (pointee_sp && error.Success()) {
345+
// if (pointee_sp->DumpPrintableRepresentation(
346+
// stream, ValueObject::eValueObjectRepresentationStyleSummary,
347+
// lldb::eFormatInvalid,
348+
// ValueObject::PrintableRepresentationSpecialCases::eDisable,
349+
// false)) {
350+
// return true;
351+
// }
352+
// }
350353

351354
stream.Printf("ptr = 0x%" PRIx64, ptr_sp->GetValueAsUnsigned(0));
352355
return true;

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
class StdSmartPtrDataFormatterTestCase(TestBase):
1313
@add_test_categories(["libstdcxx"])
1414
@expectedFailureAll(bugnumber="llvm.org/pr50861", compiler="gcc")
15+
@skipIf("T164523815")
1516
def test_with_run_command(self):
1617
self.build()
1718
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)

0 commit comments

Comments
 (0)