Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-2769] IndexPath has poor performance when bridging from objc and bridges too often for compare #3929

Closed
phausler opened this issue Sep 27, 2016 · 1 comment
Assignees

Comments

@phausler
Copy link
Member

Previous ID SR-2769
Radar rdar://problem/28209456
Original Reporter @phausler
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @phausler
Priority Medium

md5: 4c93a9dfe9392c05e2a23aead5759595

Issue Description:

IndexPath has poor performance when bridging from objc and bridges too often for compare.

public func compare(_ other: IndexPath) -> ComparisonResult incurs two bridges out to objc which would potentially allocate two NSIndexSets; this is not needed and can be done strictly in swift; which avoids allocations to compare.

fileprivate init(nsIndexPath: ReferenceType) calls malloc to fetch indices from the NSIndexSet reference. This can be done via Array which in common cases is faster.

This applies to the Darwin overlay.

@tkremenek
Copy link
Member

This was resolved by apple/swift@ffc594b

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants