owned this note changed 4 years ago
Published Linked with GitHub

怦然心動的編譯時間優化魔法 - 丁沛堯

所有議程請見議程表

歡迎來到 https://hackmd.io/@iPlayground/2019 共筆

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 →

點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。

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

  1. 取消生成dSYM (在Debug的時候)
  2. 調整Compilation Mode 選擇Incremental (只build修改過的部分), 不要選whole module
  3. 調整Optimization Level 選擇No optimization
  4. 優化CocoaPods 改podFile裡面的config
  5. 使用Carthage 取代CocoaPods
    • Carthage設定比較麻煩,下載後只需編譯一次
    • 可以把要把build比較久的三方,改到Carthage

優化程式碼

(效果比較不明顯)
2. 清楚定義變數型別

​​​​```
​​​​var x          = makeValue()
​​​​var x: String  = makeValue()
​​​​```
  1. 減少暴露不必要的介面,方法
  • func使用 private func

總結

  • 減少編譯時間
  • 分析編譯緩慢原因
  • 優化專案的編譯選項
  • 用Carthage取代要Build比較久的三方
  • 優化程式碼,減少編譯次數

https://medium.com/ichef

tags:iPlayground2019
Select a repo