top | item 8944577

Show HN: Swift vs. Objective-C Benchmarks

12 points| fyell | 11 years ago |github.com

2 comments

order
[+] lyinsteve|11 years ago|reply
Seems like performance always works in Swift's favor when the compiler is able to reason about the types (e.g. no AnyObject nonsense, banishing the objc dynamic behavior).

Interesting to see Generics performing so poorly, though.

[+] fyell|11 years ago|reply
I'm guessing the use of AnyObject is implicitly bridging Int and String to their non-struct types. The benchmark for an array with type Any seems to perform twice as fast as AnyObject.