15
Problems with Swift Yusuke Miyazaki 2014/10/25 @CAMPHOR- HOUSE Swift の問題点

Swift の問題点

Embed Size (px)

DESCRIPTION

2014/10/25 CAMPHOR- 秋のLT会で発表した「Swift の問題点」のスライドです.

Citation preview

Page 1: Swift の問題点

Problems with Swift

Yusuke Miyazaki2014/10/25 @CAMPHOR- HOUSE

Swift の問題点

Page 2: Swift の問題点

Introduction

Page 3: Swift の問題点

Swift

Page 4: Swift の問題点

Swift• WWDC 2014 で発表された, Cocoa, Cocoa Touchのための新しいプログラミング言語

• Modern / Type Safe / Interactive (REPL / Playground)

• iOS 7+, OS X 10.9 Mavericks+ に対応

Page 5: Swift の問題点

Master-Detail Application• 今後のスライドで何度か登場する, Xcode の Project Template のひとつです.

Page 6: Swift の問題点

Runtime Library

Page 7: Swift の問題点

Runtime Library• Swift のアプリでは Swift のランタイムバイナリがリンクされる

• バイナリ互換性が確保される

• バイナリサイズが増大する(Objective-C: 170KB -> Swift: 8.2MB)

OS X Yosemite / Xcode 6.1 / iOS 8.1 SDK / Master-Detail Application / Release build

Page 8: Swift の問題点

Runtime Library• App Store のサイズ制限: 100MB (Cellular)

• ランタイムのアップデートでパフォーマンスが改善されうる (Ex. Xcode 6 -> 6.1)

• 将来は OS にランタイムライブラリが組み込まれる予定

https://developer.apple.com/swift/blog/

Page 9: Swift の問題点

Build

Page 10: Swift の問題点

Build Time

OS X Yosemite / Xcode 6.1 / iOS 8.1 SDK / Master-Detail Application / Release build /

$ xcodebuild clean; time xcodebuild

Page 11: Swift の問題点

Array / Dictionary

Page 12: Swift の問題点

Array / Dictionary• Objective-C の時から利用していた Foundation.framework の NSMutableArray, NSMutableDictionary

• Swift の Array<Int>, Dictionary<Int, Int>

• どちらが速いのか?

Page 13: Swift の問題点

Without OptimizationiPhone 5s / iOS 8.1 (12B411)

-Onone

Time [sec]0 7.5 15 22.5 30

NSMutableArray Swift Array<Int>NSMutableDictionary Swift Dictionary<Int: Int>

Page 14: Swift の問題点

iPhone 5s / iOS 8.1 (12B411)

-O

Time [sec]0 0.04 0.08 0.12 0.16

NSMutableArray Swift Array<Int>NSMutableDictionary Swift Dictionary<Int: Int>

With Optimization

Page 15: Swift の問題点

まとめ• “Swift will continue to advance.” (Apple)

• Swift を採用するならいろいろ気をつけましょう

• パフォーマンス上の問題

• ビルドの問題

• 仕様の変更 (Cocoa, Cocoa Touch を含め)