[all-commits] [llvm/llvm-project] b6bf27: Avoid expression evaluation in libStdC++ std::vect...

jeffreytan81 via All-commits all-commits at lists.llvm.org
Fri Sep 13 10:26:22 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b6bf27ef3c179eefd805f39aa681705fc980ceed
      https://github.com/llvm/llvm-project/commit/b6bf27ef3c179eefd805f39aa681705fc980ceed
  Author: jeffreytan81 <jeffreytan at meta.com>
  Date:   2024-09-13 (Fri, 13 Sep 2024)

  Changed paths:
    M lldb/examples/synthetic/gnu_libstdcpp.py
    M lldb/include/lldb/API/SBValue.h
    M lldb/source/API/SBValue.cpp

  Log Message:
  -----------
  Avoid expression evaluation in libStdC++ std::vector<bool> synthetic children provider  (#108414)

Our customers is reporting a serious performance issue (expanding a this
pointer takes 70 seconds in VSCode) in a specific execution context.

Profiling shows the hot path is triggered by an expression evaluation
from libStdC++ synthetic children provider for `std::vector<bool>` since
it uses `CreateValueFromExpression()`.

This PR added a new `SBValue::CreateBoolValue()` API and switch
`std::vector<bool>` synthetic children provider to use the new API
without performing expression evaluation.

Note: there might be other cases of `CreateValueFromExpression()` in our
summary/synthetic children providers which I will sweep through in later
PRs.

With this PR, the customer's scenario reduces from 70 seconds => 50
seconds. I will add other PRs to further optimize the remaining 50
seconds (mostly from type/namespace lookup).

Testing:

`test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py`
passes with the PR

---------

Co-authored-by: jeffreytan81 <jeffreytan at fb.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list