怦然心動的編譯時間優化魔法 - 丁沛堯
YouTube
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
product -> perform action -> build with Timing summary
優化Build Setting
- 取消生成dSYM (在Debug的時候)
- 調整Compilation Mode 選擇Incremental (只build修改過的部分), 不要選whole module
- 調整Optimization Level 選擇No optimization
- 優化CocoaPods 改podFile裡面的config
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 使用Carthage 取代CocoaPods
- Carthage設定比較麻煩,下載後只需編譯一次
- 可以把要把build比較久的三方,改到Carthage
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
優化程式碼
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
(效果比較不明顯)
2. 清楚定義變數型別
```
var x = makeValue()
var x: String = makeValue()
```
- 減少暴露不必要的介面,方法
總結
- 減少編譯時間
- 分析編譯緩慢原因
- 優化專案的編譯選項
- 用Carthage取代要Build比較久的三方
- 優化程式碼,減少編譯次數
https://medium.com/ichef