• 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: memmove in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memmove in Swift


  • Subject: Re: memmove in Swift
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Thu, 21 Aug 2014 13:18:34 +0700

On 21 Aug 2014, at 11:53, Marco S Hyman <email@hidden> wrote:

> On Aug 20, 2014, at 8:32 PM, Gerriet M. Denkmann <email@hidden> wrote:
>
>> But I thought that maybe memmove might be more efficient:
>
> Optimizing already?

Not really. More like learning.

Actually I was checking the results of Jesse Squires <http://www.jessesquires.com/apples-to-apples-part-two/> where he says:
"Swift has performed better than Objective-C for every single algorithm, with standard optimizations. And not only is Swift faster, but it is faster by significant margins."

As it turns out he compared Obj-C using NSMutableArrays with Swift using [Int]. Not really comparing Apples with Apples.


My test (using [UInt32] for both Swift and ObjC) showed:

1. Swift beta 6 takes about twice the time of ObjC. Not really "faster by significant margin".
2. the build-in Swift function sorted(array) crashes with an array of size 10 million and values in the range 0 ... 100. Probably due to excessive recursion.
3. the build-in Swift function sorted(array) with an array of size 10 million and values in the range 0 ... 1000 is about 100 times slower than my own quickSort.

I know, Swift is still beta, so I am not complaining.
Only it annoyed me to see highly publicised results which are not quite fair.


Kind regards,

Gerriet.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: memmove in Swift
      • From: Greg Parker <email@hidden>
    • Re: memmove in Swift
      • From: Roland King <email@hidden>
References: 
 >memmove in Swift (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: memmove in Swift (From: Marco S Hyman <email@hidden>)

  • Prev by Date: Re: memmove in Swift
  • Next by Date: Re: memmove in Swift
  • Previous by thread: Re: memmove in Swift
  • Next by thread: Re: memmove in Swift
  • Index(es):
    • Date
    • Thread