|
|
| Previous ID |
SR-6197 |
| Radar |
None |
| Original Reporter |
fumoboy007 (JIRA User) |
| Type |
Bug |
Attachment: Download
Environment
Apple Swift version 4.0 (swiftlang-900.0.65.2 clang-900.0.37)
Target: x86_64-apple-macosx10.9
macOS 10.13
Additional Detail from JIRA
|
|
| Votes |
2 |
| Component/s |
Compiler, Standard Library |
| Labels |
Bug |
| Assignee |
None |
| Priority |
Medium |
md5: d13ea9787b0d44984c429de46b2d6547
Issue Description:
`NSTextStorage` vs. `TextStorageSwiftSubclass`
Calling `-[NSTextStorage attributesAtIndex:effectiveRange:]` is nearly 3 times as slow for `TextStorageSwiftSubclass` compared to `NSTextStorage`. Time profiling shows that this is caused by the bridging of the Objective-C dictionary return value to Swift. Effectively, this means we cannot use Swift if we want to subclass `NSTextStorage`.
Sample project and time profiler trace are attached.
Attachment: Download
Environment
Apple Swift version 4.0 (swiftlang-900.0.65.2 clang-900.0.37)
Target: x86_64-apple-macosx10.9
macOS 10.13
Additional Detail from JIRA
md5: d13ea9787b0d44984c429de46b2d6547
Issue Description:
`NSTextStorage` vs. `TextStorageSwiftSubclass`
Calling `-[NSTextStorage attributesAtIndex:effectiveRange:]` is nearly 3 times as slow for `TextStorageSwiftSubclass` compared to `NSTextStorage`. Time profiling shows that this is caused by the bridging of the Objective-C dictionary return value to Swift. Effectively, this means we cannot use Swift if we want to subclass `NSTextStorage`.
Sample project and time profiler trace are attached.