Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Build Time Analyzer
Search
M
March 04, 2018
Programming
0
130
Build Time Analyzer
ビルド時間の改善
M
March 04, 2018
Tweet
Share
More Decks by M
See All by M
Combine
matsuda
0
69
Swift 5.1 - Property Wrapper
matsuda
0
40
Swift 5.1
matsuda
0
30
SafeArea
matsuda
0
51
URLProtocol
matsuda
0
63
APIKit
matsuda
0
89
Other Decks in Programming
See All in Programming
カスタムしながら理解するGraphQL Connection
yanagii
1
1.2k
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
1k
RailsのPull requestsのレビューの時に私が考えていること
yahonda
5
1.7k
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
480
/←このスケジュール表に立ち向かう フロントエンド開発戦略 / A front-end development strategy to tackle a single-slash schedule.
nrslib
1
590
Realtime API 入門
riofujimon
0
110
Macとオーディオ再生 2024/11/02
yusukeito
0
150
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
400
2万ページのSSG運用における工夫と注意点 / Vue Fes Japan 2024
chinen
3
1.3k
VR HMDとしてのVision Pro+ゲーム開発について
yasei_no_otoko
0
100
Golang と Erlang
taiyow
8
1.9k
Featured
See All Featured
BBQ
matthewcrist
85
9.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
290
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Fireside Chat
paigeccino
32
3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
Rails Girls Zürich Keynote
gr2m
93
13k
Teambox: Starting and Learning
jrom
132
8.7k
A designer walks into a library…
pauljervisheath
202
24k
Adopting Sorbet at Scale
ufuk
73
9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
107
49k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Transcript
Ϗϧυ࣌ؒͷվળ 2018/02/23
͡Ίʹ • 2ఔલʹSwiftͷϏϧυ࣌ؒͷ͕͞ʹ • ରࡦํ๏͍͔ͭ͘հ͞Ε͍ͯͨΓͨ͠ • ͍ࣗͱײ͡Δ͜ͱ͋Γࢼͯ͠Έ͍ͨ ͱࢥ͍͕ͬͯͨɺ࣮ࡍʹࢼͨ͜͠ͱͳ͔ͬ ͨ
͡Ίʹ • ϓϩδΣΫτͷίʔυΛݟͨ࣌ʹ͜ΕϠ όͦ͏ͱࢥͬͨ • ࣮ࡍɺͳ͔ͬͨ͘ • ͕࣌ؒͰ͖ͨͷͰࢼͯ͠Έͨ
Ϗϧυ࣌ؒͷܭଌ
શମͷϏϧυ࣌ؒ • defaultsίϚϯυͰXcode্ʹϏϧυ࣌ؒΛද ࣔͰ͖ΔΑ͏ʹઃఆ͢Δ
શମͷϏϧυ࣌ؒ • DerivedDataআ • ΫϦʔϯʢ㵰+⇧+Kʣ • Ϗϧυʢ㵰+Bʣ
શମͷϏϧυ࣌ؒ • DerivedDataআ • ΫϦʔϯʢ㵰+⇧+Kʣ • Ϗϧυʢ㵰+Bʣ
None
ܭଌ༻ͷϏϧυઃఆΦϓγϣϯ -Xfrontend Swift compiler flags
[Build Settings] -> [OTHER_SWIFT_FLAGS] ʹઃఆ
-debug-time-function-bodies • -Xfrontend -debug-time-function-bodies • ϝιουผͷίϯύΠϧ࣌ؒΛଌఆ
-warn-long-function-bodies • -Xfrontend -warn-long-function-bodies=100 • ίϯύΠϧʹ100msҎ্͔͔͍ͬͯΔίʔυΛܯࠂ • Swift3.0Ҏ߱Ͱ༗ޮʁ • কདྷతʹআ͞ΕΔՄೳੑ
• https://github.com/apple/swift/commit/ 18c75928639acf0ccf0e1fb6729eea75bc09cbd5
-warn-long-expression-type- checking • -Xfrontend -warn-long-expression-type- checking=50 • ܕਪʹ50msҎ্͔͔͍ͬͯΔίʔυΛܯࠂ • Xcode9
GM͔Β
None
None
ϓϩδΣΫτ • Swift2.2 & Xcode7.1.1 • -warn-long-function-bodies -warn-long-expression-type-checking ͕͑ͳ͍
Ҏ߱ Swift2.2+Xcode7.1.1 ͰͷௐࠪͰ͢
ϝιουຖͷܭଌ
ܭଌπʔϧ • xcodebuild http://irace.me/swift-profiling • Build Time Analyzer for Xcode
https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode • xcprofiler
ܭଌπʔϧ • xcodebuild http://irace.me/swift-profiling • Build Time Analyzer for Xcode
https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode • xcprofiler
• gem install xcprofiler • Build Settings -> Other Swift
Flagsʹ -Xfrontend -debug-time-function-bodies Λઃఆ • Ϗϧυ • xcprofiler [PRODUCT_NAME or ACTIVITY_LOG_PATH] [options] xcprofiler
xcprofiler
None
ίʔυϕʔεͰͷվળ
ίʔυϕʔεͰͷվળ 1.ܕਪ ʢλΠϓώϯςΟϯάɺClosureɺGenericsʢϝιουνΣΠϯʣʣ 2.݁߹ʢྻɺจࣈྻʣ 3.Closures and lazy properties 4.Ternary Conditional
Operatorʢࡾ߲ԋࢉࢠʣ 5.Nil-Coalescing Operatorʢ??ʣ
ίʔυϕʔεͰͷվળ 1.ܕਪ ʢλΠϓώϯςΟϯάɺClosureɺGenericsʢϝιουνΣΠϯʣʣ 2.݁߹ʢྻɺจࣈྻʣ 3.Closures and lazy properties 4.Ternary Conditional
Operatorʢࡾ߲ԋࢉࢠʣ 5.Nil-Coalescing Operatorʢ??ʣ
ܕਪ λΠϓώϯςΟϯά
None
ྻͷλΠϓώϯςΟϯάΛ ͚Δ
Ϗϧυ࣌ؒ NT CFGPSF BGUFS ʢ‑ʣ
ܕਪ Closure
None
$MPTVSFʹܕΛ໌ࣔ
Ϗϧυ࣌ؒ NT CFGPSF BGUFS ʢ‑ʣ
ܕਪ GenericsʢϝιουνΣΠϯʣ
None
ϥΠϒϥϦ3VOFTʹΑΔ ΦϖϨʔλʔͷར༻ΛΊΔ ϝιουνΣΠϯΛΊΔ
Ϗϧυ࣌ؒ NT CFGPSF BGUFS ʢ‑ʣ
ྻͷ݁߹
Before
ԋࢉࢠΛBQQFOEϝιουʹมߋ
Ϗϧυ࣌ؒ NT CFGPSF BGUFS ʢ‑ʣ
จࣈྻͷ݁߹
Before
ԋࢉࢠΛΊͯ ΠϯϥΠϯల։ʹมߋ
Ϗϧυ࣌ؒ NT CFGPSF BGUFS ʢ‑ʣ
ԋࢉࢠΛKPJOϝιουʹมߋ
Ϗϧυ࣌ؒ NT CFGPSF BGUFS ʢ‑ʣ
ίʔυϕʔεҎ֎Ͱͷվળ https://github.com/fastred/Optimizing-Swift- Build-Times
None
·ͱΊ
• ͪΐͬͱͨ͠มߋͰ͔ͳΓͷ͕࣌ؒॖ • ඵʗ630ඵͷॖͳͷͰɺຊʹվળ͞Εͨͷ͔࣮ ײ͕ͳ͍ʢମײతʹϏϧυ࣌ؒ15͙Β͍ʣ • Not Swifty • Swiftݴޠ༷Λ׆͔ͨ͠هड़͕Ͱ͖ͳ͍
• ίʔυྔͷ૿Ճ • ίʔυͷՄಡੑ͕͕͋Δ߹ • ܕΛ໌ࣔ͢Δ͜ͱͰѲ͘͢͠ͳΔ
• Swift2.2+Xcode7.1.1ͷڥͰͷௐࠪͳͷͰɺ ࠓͷ࠷৽ͷSwift4+Xcode9ͷڥͰվળ͞ Ε͍ͯΔͷ͋Δͣ
Swiftyͳίʔυॻ͖ͭͭɺ ۠Γͷ͍͍ͱ͜ΖͰܭଌ͠ ͯΈͯɺۃʹϏϧυʹ࣌ؒ ͕͔͔͍ͬͯΔ߹ίʔυ Λݟͯ͠ΈΔ
Appendix • https://developers.cyberagent.co.jp/blog/archives/7815/ • https://medium.com/@fkei/xcodeͷϏϧυ࣌ؒΛॖ͢Δ ํ๏·ͱΊ-2017-10-20࣌-bea6dc4f9fc0 • https://qiita.com/ruwatana/items/21b25781a2f44ccf29e2 • https://qiita.com/you_matz/items/
e95f30023eccc8d96357 • https://qiita.com/rizumita/items/913b05d799b3712260f6