Re: Is Swift really swift?
Re: Is Swift really swift?
- Subject: Re: Is Swift really swift?
- From: Jens Alfke <email@hidden>
- Date: Tue, 08 Jul 2014 22:03:39 -0700
On Jul 8, 2014, at 7:09 PM, Gerriet M. Denkmann < email@hidden> wrote: Lesson learned: Swift inter-operates with Obj-C at quite a hight cost.
I think what you’re seeing is that, in a class that subclasses NSObject, methods are called using Obj-C dispatching (via objc_msgsend), which is a lot more expensive than the native Swift dispatching (closer to C++, i.e. using some mixture of vtables, direct function calls and inlining.)
Also, I was told by an Apple engineer at WWDC that native Swift objects have significantly faster retain/release implementations than Obj-C due to the lack of backward compatibility requirements. (IIRC, the main factor is that Swift objects can store the retainCount as a regular ivar, while Obj-C objects don’t have room and have to store it in an external global hash-table.)
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden