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
Haze - Real time background blurring
chrisbanes
1
510
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
Zoneless Testing
rainerhahnekamp
0
120
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
130
선언형 UI에서의 상태관리
l2hyunwoo
0
160
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
return文におけるstd::moveについて
onihusube
1
1.1k
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
For a Future-Friendly Web
brad_frost
175
9.4k
Scaling GitHub
holman
458
140k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
How STYLIGHT went responsive
nonsquared
95
5.2k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
450
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
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