Skip to content

[6.0][Runtime] Use StackAllocatedDemangler in getLibPrespecializedMetadata. #73206

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

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Apr 23, 2024

Cherry-pick #73205 to release/6.0.

Reduce the amount of time spent freeing demangler slabs by starting out with a stack allocation that doesn't need to be freed.

rdar://126932780

…adata.

Reduce the amount of time spent freeing demangler slabs by starting out with a stack allocation that doesn't need to be freed.

rdar://126932780
(cherry picked from commit 717b03b)
@mikeash mikeash requested a review from a team as a code owner April 23, 2024 19:54
@mikeash
Copy link
Contributor Author

mikeash commented Apr 23, 2024

Explanation: Use 4kB of stack as the initial pool for the Demangler to reduce heap churn and improve performance.
Original PR: #73205
Reviewed by: @tbkka
Risk: Low. We use an existing stack-allocating Demangler subclass. We reserve 4kB of additional stack space which has some small risk of pushing something over the edge and running out of stack, but that's not a large amount.
Resolves: rdar://126932780
Tests: Manual testing to verify the change, and automated tests will exercise this code as part of metadata lookup.

@mikeash
Copy link
Contributor Author

mikeash commented Apr 24, 2024

@swift-ci please test

1 similar comment
@mikeash
Copy link
Contributor Author

mikeash commented Apr 25, 2024

@swift-ci please test

@mikeash mikeash merged commit b97b27d into swiftlang:release/6.0 Apr 26, 2024
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