You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While benchmarking, I found that this was taking an incredible amount of time - up to 15% of parsing a URL, with almost all of that coming from String creation:
With one modification: changing decoding to `UTF8.self`, we can get literally an order of magnitude better performance:
I understand that UTF8 is String's native encoding and has certain fast-paths, but ASCII is a restricted subset of UTF8 and should be even easier to validate and repair (if needed). I would certainly not expect it to be 10x slower! That's just too much.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
Xcode Version 11.5 (11E608c), macOS 10.15.2
Additional Detail from JIRA
md5: 69390e8b97a32575471cd6fb5ab50fa4
Issue Description:
Take the following code, which is part of a parser for URL schemes:
While benchmarking, I found that this was taking an incredible amount of time - up to 15% of parsing a URL, with almost all of that coming from String creation:
With one modification: changing decoding to `UTF8.self`, we can get literally an order of magnitude better performance:
I understand that UTF8 is String's native encoding and has certain fast-paths, but ASCII is a restricted subset of UTF8 and should be even easier to validate and repair (if needed). I would certainly not expect it to be 10x slower! That's just too much.
The text was updated successfully, but these errors were encountered: