Re: Is Swift really swift?
Re: Is Swift really swift?
- Subject: Re: Is Swift really swift?
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sun, 06 Jul 2014 23:45:30 +0700
On 6 Jul 2014, at 23:38, Thomas Clement <email@hidden> wrote:
>
> On 06 Jul 2014, at 18:02, Gerriet M. Denkmann <email@hidden> wrote:
>
>>
>> On 6 Jul 2014, at 03:23, Jens Alfke <email@hidden> wrote:
>>
>>>
>>> On Jul 5, 2014, at 12:48 PM, Gerriet M. Denkmann <email@hidden> wrote:
>>>
>>>> Using maskArray took 15 sec. This is 160 times slower than computing directly: 0.09 sec (1.25 slower than Obj-C).
>>>
>>> . Have you tried CFBitVector?
>>
>> Using Time Profiler in Instruments I have found that my Obj-C version uses
>> 4616 ms for the main function + CFBitVector functions
>>
>> Swift uses about the same: 4778 ms
>> To be added: 172 ms for stuff which was just a #define in Obj-C
>>
>>
>> But then there is a huge difference in overhead:
>> Obj-C has just 5 ms for CFRelease
>>
>> But Swift has:
>> 10258 ms for CFRelease, CFRetain, objc_release, objc_retain, -[NSObject retain], -[__NSCFType retain], objc_msgSend etc.
>>
>> Finally also 139 ms for convertBoolToObjCBool and back
>>
>> If someone is interested in looking at this code: I am very willing to share it.
>> It is not very big - about 200 lines per version.
>>
>> Maybe there is some obvious mishandling of Swift in my code. My experience with Swift is less than a week.
>
> What are the optimization levels in use for your builds? You should probably use "Fastest, Unchecked [-Ofast]" under the "Swift Compiler - Code Generation" build settings for your swift code. Similarly you can use "Fastest, Smallest [-Os]" (or "Fastest, Agressive Optimizations [-Ofast]") under the "Apple LLVM 6.0 - Code Generation" build settings for your Objecitve-C code.
I am using -Ofast for all compilations.
Gerriet.
_______________________________________________
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