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
Implementing a QuadraticSequence from 2 standard Sequence as a generic protocol creates code that is 30x slower than a direct Sequence/Iterator implementation. Not sure if this is expected or if there are specifics in this code that explain the situation.
I was instructed to run it through SIL tools to inspect code. You'll find the original source code, SIL outout as attachement.
Note that the source code has both the generic protocol approach and the direct implementation which can be switched easily.
Attachment: Download
Environment
Swift 4.2, Xcode 10.1
Additional Detail from JIRA
md5: 965f7db04ca779e059daf35461f1157a
Issue Description:
Implementing a QuadraticSequence from 2 standard Sequence as a generic protocol creates code that is 30x slower than a direct Sequence/Iterator implementation. Not sure if this is expected or if there are specifics in this code that explain the situation.
I was instructed to run it through SIL tools to inspect code. You'll find the original source code, SIL outout as attachement.
Note that the source code has both the generic protocol approach and the direct implementation which can be switched easily.
Original discussion (forum): https://forums.swift.org/t/performance-of-generic-protocol-extension-30x-slower-swift-4-2/18582
Here's the test code:
The text was updated successfully, but these errors were encountered: