> On 5 Jul 2016, at 18:21, Jordan Rose <[email protected]> wrote:
> 
> Longstanding bug, rdar://problem/17277899 <rdar://problem/17277899>. 
> Surprisingly few people have asked for it.
> 
> Jordan
> 

Good to know, thanks.

Maybe not enough people know/care about the overheads of weak references?

Since the WWDC Swift performance talk I’ve been more conscious of eliminating 
unnecessary retains/releases. That goes for weak references as well, as 
(certainly on Obj-C), accessing the value means acquiring a lock to ensure 
nobody is trying to zero that reference while you read it: 
http://opensource.apple.com//source/objc4/objc4-493.9/runtime/objc-arr.mm 
<http://opensource.apple.com//source/objc4/objc4-493.9/runtime/objc-arr.mm> 
(see: objc_loadWeak). It’s basically never going to be in contention, but it’s 
still more overhead than a simple pointer.

Karl
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to