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
140
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
31
SafeArea
matsuda
0
51
URLProtocol
matsuda
0
63
APIKit
matsuda
0
91
Other Decks in Programming
See All in Programming
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
2
460
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
たのしいparse.y
ydah
3
120
Refactor your code - refactor yourself
xosofox
1
260
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
770
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
talk-with-local-llm-with-web-streams-api
kbaba1001
0
180
Go の GC の不得意な部分を克服したい
taiyow
2
770
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
930
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
Typedesign – Prime Four
hannesfritz
40
2.4k
It's Worth the Effort
3n
183
28k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Building Your Own Lightsaber
phodgson
103
6.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Producing Creativity
orderedlist
PRO
341
39k
Faster Mobile Websites
deanohume
305
30k
Writing Fast Ruby
sferik
628
61k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
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