Skip to content

[lldb] Stop demangling every swift symbol into strings #10841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: swift/release/6.2
Choose a base branch
from

Conversation

kastiglione
Copy link

@kastiglione kastiglione commented Jun 13, 2025

InitNameIndexes loops over symbols and builds internal indexes. For Swift symbols (of type eSymbolTypeCode), the symbol is demangled into a node tree, and the node tree is used to extract method names, etc.

Previously, all other Swift symbols (non-code), were being demangled into strings. However this appears unnecessary, skipping such Swift symbols has the following benefits:

  • saves time and memory costs of demangling into a string
  • reduces entries in the string pool
  • reduces sizes of the symbol table indexes

In a trivial example, the number of log entries for demangling to strings went from 58682 to 0.

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione kastiglione changed the title [lldb] Stop demangling all swift symbols [lldb] Stop demangling every swift symbol into strings Jun 16, 2025
@kastiglione kastiglione marked this pull request as ready for review June 16, 2025 17:15
@kastiglione kastiglione requested a review from a team as a code owner June 16, 2025 17:15
Copy link

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it would be nice if we could find a way to detangle all the Swift-specific code in this file and move it into plugins/Language(Runtime)/Swift

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants