[SR-10673] CaseIterable
performance gets worse when used in inlinable function
#53073
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
performance
Environment
XCode 10.2.1
Swift 5.0.1
Additional Detail from JIRA
md5: 5ce7e64437531ece9384c24ccb8dc264
Issue Description:
I tested above code with time profiler in 3 cases.
Case 1: `test` is not inlinable && use automatically implemented `allCases` -> 27ms
Case 2: Make `test` inlinable && use automatically implemented `allCases` -> 480ms
Case 3: Make `test` inlinable && use manually implemented inlinable `allCases` -> 29ms
In case 2, `RGB.allCases` is always allocating array.
It seems optimization is not working well.
The text was updated successfully, but these errors were encountered: