Skip to content
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

Improve namespace lookup using .debug_names parent chain #2

Conversation

jeffreytan81
Copy link
Owner

Summary

This PR is a continuation of llvm#108907 by using .debug_names parent chain faster lookup for namespaces.

Implementation

Similar to llvm#108907. This PR adds a new API: GetNamespacesWithParents in DWARFIndex base class. The API performs the same function as GetNamespaces() with additional filtering using parents CompilerDeclContext. A default implementation is given in DWARFIndex class which parses debug info and performs the matching. In the DebugNameDWARFIndex override, parents CompilerDeclContext is cross checked with parent chain in .debug_names for much faster filtering before fallback to base implementation for final filtering.

Performance Results

For the same benchmark used in llvm#108907, this PR improves: 48s => 28s

@jeffreytan81 jeffreytan81 force-pushed the improve_namespace_lookup_review branch from 985ba4f to 9a020d8 Compare September 26, 2024 00:17
@jeffreytan81 jeffreytan81 marked this pull request as draft September 26, 2024 00:20
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.

1 participant