-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfperformancestandard libraryArea: Standard library umbrellaArea: Standard library umbrella
Description
| 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.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfperformancestandard libraryArea: Standard library umbrellaArea: Standard library umbrella