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 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