• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is Swift really swift?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is Swift really swift?


  • Subject: Re: Is Swift really swift?
  • From: Thomas Clement <email@hidden>
  • Date: Sun, 06 Jul 2014 18:38:55 +0200

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.

Thomas


 _______________________________________________
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


  • Follow-Ups:
    • Re: Is Swift really swift?
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >Is Swift really swift? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Is Swift really swift? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Is Swift really swift? (From: Jens Alfke <email@hidden>)
 >Re: Is Swift really swift? (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: Is Swift really swift?
  • Next by Date: Re: Is Swift really swift?
  • Previous by thread: Re: Is Swift really swift?
  • Next by thread: Re: Is Swift really swift?
  • Index(es):
    • Date
    • Thread