[SR-9438] Rewrite _uint64ToString etc to Swift #51902
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: 984ad19ce0bea9e1b771a70ebcb45775
relates to:
Issue Description:
The standard library has `String(_:radix:uppercase:)`, generic over `BinaryInteger`. However, almost-100% of the time, that BinaryInteger can be represented as an Int64. Also, 99% of the time that base is 10 or 16, and almost all of the rest is either 2 or 8. We should fast-path these most common usage.
Currently, we do have some checks inside `BinaryInteger._description(radix:uppercase:)`, which checks if bit-width is <= 64, calling `_[u]int64ToString`, but the cold path is not outlined.
`_[u]int64ToString` itself could be greatly improved for common radii, should be able to write its contents directly into a pre-allocated String buffer (or small string when appropriate), and shouldn't rely on the C function `_[u]int64ToStringImpl`
rdar://problem/45768132
The text was updated successfully, but these errors were encountered: