Skip to content

Prefer unsafeBitcast on arrays, the as! is costly#21

Merged
ktoso merged 1 commit into
swiftlang:mainfrom
ktoso:wip-unsafe-cast-self
Apr 22, 2026
Merged

Prefer unsafeBitcast on arrays, the as! is costly#21
ktoso merged 1 commit into
swiftlang:mainfrom
ktoso:wip-unsafe-cast-self

Conversation

@ktoso
Copy link
Copy Markdown
Collaborator

@ktoso ktoso commented Apr 22, 2026

This turns out to be a noticable improvement for array conversions

Copy link
Copy Markdown
Contributor

@marcprux marcprux left a comment

Choose a reason for hiding this comment

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

Nice!

@ktoso
Copy link
Copy Markdown
Collaborator Author

ktoso commented Apr 22, 2026

I'll share some more benchmarks in swift-java later on, a bit can't believe some of the results I'm seeing, but this is a good improvement anyway 😉

@ktoso ktoso merged commit b440a0b into swiftlang:main Apr 22, 2026
60 checks passed
@ktoso ktoso deleted the wip-unsafe-cast-self branch April 22, 2026 12:51
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