[all-commits] [llvm/llvm-project] 763b96: [lldb] Avoid (unlimited) GetNumChildren calls when...

Pavel Labath via All-commits all-commits at lists.llvm.org
Mon Jun 3 01:35:06 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 763b96c86d81d51d0db430791a61fd1e8a406bce
      https://github.com/llvm/llvm-project/commit/763b96c86d81d51d0db430791a61fd1e8a406bce
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2024-06-03 (Mon, 03 Jun 2024)

  Changed paths:
    M lldb/source/DataFormatters/FormatManager.cpp
    M lldb/source/DataFormatters/ValueObjectPrinter.cpp
    M lldb/test/API/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
    M lldb/test/API/functionalities/data-formatter/synthcapping/fooSynthProvider.py

  Log Message:
  -----------
  [lldb] Avoid (unlimited) GetNumChildren calls when printing values (#93946)

For some data formatters, even getting the number of children can be an
expensive operations (e.g., needing to walk a linked list to determine
the number of elements). This is then wasted work when we know we will
be printing only small number of them.

This patch replaces the calls to GetNumChildren (at least those on the
"frame var" path) with the calls to the capped version, passing the
value of `max-children-count` setting (plus one)



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