• 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: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sun, 06 Jul 2014 02:48:59 +0700

On 6 Jul 2014, at 00:38, Jens Alfke <email@hidden> wrote:

>
> On Jul 5, 2014, at 6:48 AM, Gerriet M. Denkmann <email@hidden> wrote:
>
>> Swift is 200 times slower: 1.7 ↔ 0.0085 sec
>> Probably I am not using Swift very expertly. Also I know that this is not the final version of Swift - but still.
>
> If you’re getting such huge differences, then I suspect you’re doing something wrong.
Quite likely.

I have a heavily used array called maskArray ( maskArray[i] = 0x1 << i ).

I summed this array 100 Mio times in Objective-C
Took 0.05 sec. This is 1.5 times faster than NOT using maskArray, instead computing the value directly (0.075 sec)
uint32_t	 maskArray[32];

Did the same in Swift.
Using maskArray took 15 sec. This is 160 times slower than computing directly: 0.09 sec (1.25 slower than Obj-C).
And it is 300 times slower than Obj-C.

var maskArray = UInt32[](count: Int(32), repeatedValue: 0)


Kind regards,

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


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

  • Prev by Date: Re: Sudden provisioning profile issues
  • 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