Workaround allocation regression caused by missing specialized [Substring].joined
#161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The specialization for
[Substring].joined
was dropped in Swift 5.91 and consequently we regressed in allocations2.Modifications
Workaround the lack of specialized
[Substring].joined
by handwriting the comma-separated concatenation of the SSH algorithms.Result
Reduces the allocations to below what they were prior to the toolchain regression.
Notes
As a baseline, I was using
d23c142
of this repo, which is a commit from around the time of the toolchain regression.The allocation results are as follows:
From this we infer:
2023-07-25
and2023-07-29
.5.9-RELEASE
.For more information on the Swift issue, including reproducer package and
heaptrack
outputs, see the Swift issue1.Footnotes
https://github.com/apple/swift/issues/69883 ↩ ↩2
Update allocation results #157 ↩