Skip to content

Commit 8fafdd1

Browse files
committed
Add @Always(__inline) to _parseInteger(UnsafeBufferPointer<UInt8>, Int)
Integer parsing seems to be very sensitive to inlining. With simplifycfg, _parseInteger function gets bigger and ends up not being inlined causing significant performance regression in the integer parsing benchmarks. Add @Always(__inline) to recover the performance.
1 parent 8bf75f0 commit 8fafdd1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/core/IntegerParsing.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ internal func _parseIntegerDigits<Result: FixedWidthInteger>(
5757
}
5858

5959
@_alwaysEmitIntoClient
60+
@inline(__always)
6061
internal func _parseInteger<Result: FixedWidthInteger>(
6162
ascii codeUnits: UnsafeBufferPointer<UInt8>, radix: Int
6263
) -> Result? {

0 commit comments

Comments
 (0)