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

[SR-10095] FloatingPoint.init?<S: StringProtocol>(_ text: S) forces UTF16 conversion #52497

Closed
troughton opened this issue Mar 12, 2019 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. good first issue Good for newcomers performance standard library Area: Standard library umbrella

Comments

@troughton
Copy link
Contributor

Previous ID SR-10095
Radar None
Original Reporter @troughton
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, Performance, StarterBug
Assignee @troughton
Priority Medium

md5: 54e7e02e55e8b7d5628f5bba260a1da0

Issue Description:

Under Swift 5, native UTF8 strings are forced to have a UTF16 representation created when used with `FloatingPoint.init(StringProtocol)` (https://github.com/apple/swift/blob/master/stdlib/public/core/FloatingPointParsing.swift.gyb). This is a performance bug; ideally, floating point parsing should not require format conversion.

@milseman
Copy link
Mannequin

milseman mannequin commented Apr 22, 2019

Sorry, Thomas, did you want to try this one?

@troughton
Copy link
Contributor Author

I think #24198 should be all that’s needed for this, unless I’m missing some edge case.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. good first issue Good for newcomers performance standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

1 participant